‎2011 Sep 23 7:27 AM
Hi All,
Do we have any function module to conver epoch time.
Epoch time means
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970)
For more details refer
http://www.epochconverter.com/
Regards
Murali.K
‎2011 Sep 23 7:39 AM
Hi,
Cant we build the logic by finding the number of seconds by subtracting the current date with 1.1.1970. ?
Kesav
‎2011 Sep 23 7:45 AM
Hi,
I dont know ABAP, can you please help me if you can give the code.
Regards
Murali.K
‎2011 Sep 23 7:53 AM
Hi,
I searched and got the Unix commnd to get the Epoch time stamp, its date +%s
There are some methods to execute the unix command which i know but I am not sure of any methods which returns the value of the executed command.
I got this syntax from some links and done some modifications which you can try, i have not checked it
types:begin of ty,
line(200),
end of ty.
data:it type tale of ty.
data: COMMAND(1000) type c.
command = 'date +%s'
CALL 'SYSTEM' ID 'COMMAND' FIELD COMMAND
ID 'TAB' FIELD it-*SYS*.
Check the internal table it.
Please note that i have not tested it.
kesav
‎2011 Sep 23 9:43 AM
Look at standard FM RKE_TIMESTAMP_CONVERT_INPUT and RKE_TIMESTAMP_CONVERT_OUTPUT, those convert FM refer to a zero date
DATA: REL_DATE LIKE SY-DATUM VALUE '19900101', " BezugsdatumYou could copy the Function group and FM and change this value for '19700101' in the copied FG, or use those FM and add/remove the number of seconds between first day of 1970 and 1990. (20 years, 7305 days, 175320 hours so 631152000 seconds)
Don't forget also that some days are 86401 sec long and not 86400 ([leap seconds|http://en.wikipedia.org/wiki/Leap_seconds])...
Regards,
Raymond
‎2014 Oct 29 10:52 PM