Merchant Archive
Thread: HowTo: Converting Timestamp to Date & Time
Page 1 of 1
Ewach
Sat Nov 29, 2003 1:01 am
#1
I saved a message and reverse engineered the TIMESTAMP to known date/time in message using Excel.
The timestamp is number of seconds elapsed since a reference date & time.
Looks to me like the reference date/time is: 1 Jan 1970 06:00:00
To convert timestamp to date & time:
days = @int(timestamp/86400) {divide by total number of secs in day to find number of days}
remainder = timestamp - (days * 86400) {find number of seconds remaining on current day}
hour = @int(remainder / 3600) {find number of hours}
remainder = remainder - (hour * 3600)
minutes = @int(remainder/60) {find number of minutes}
remainder = remainder- (minutes * 60)
seconds = remainder
In Excel, add days to reference date (1/1/1970) to get the current date.
Tripp
Sat Nov 29, 2003 9:14 am
#2
Ah! standard Unix timestamp. Unix keeps track of time as number of seconds since 1/1/1970.
PepeGSay
Sat Nov 29, 2003 8:03 pm
#3
Ewaxh, you probably see it as 6:00 1/1/970 because you are six hours from West Coast time.
Page 1 of 1