Merchant Archive

Thread: HowTo: Converting Timestamp to Date & Time

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.




SWG Lexicon: "Every Player" Means "Except Crafters"



Ewach - Founder of Travelers Respite on Sunrunner
Located halfway between Anchorhead and Mos Eisley (2180, -4684)
Visit my Shop at (2030, -4660)
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.



Major Tyas Duskchaser - Elder Smuggler/Master Freelance Pilot. Nothing else matters.
Wandering the wastes of Tatooine, Eclipse Server.
"I can't give you the location of the rebel bases here. For less than 5k per base."

Tyar Eyurn Rebel Jedi. Have X-Wing Advanced, will travel.
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.



Tiquor Canche - Intrepid
Stim City: Naboo, Moenia 5326 -4084 Meds & A Ton of Other Merchants
Proud Member of SIN (Strength In Numbers)

+20 Medical, Combat Medical & Chef Experimentation
"When your HAM is looking shi&&y, you'll be glad you shopped at Stim City"
Merchant Email Processor available at http://www.thedotcommakesitfunny.com/swg/ Now on Alpha 11.

Page 1 of 1
Previous Next