October 17, 200619 yr Hello all, i am trying to parse a logfile which begins with a timestamp like this "1146707632" . on mac osx, running date -r 1146707632 show that it means Thu May 4 09:53:52 HKT 2006 . is there a sane way to calculate timestamps to unix / epoch time and back? thanks a lot, overrider
October 17, 200619 yr To convert Unix time to Filemaker timestamp: UnixTime + 62135596800 + TZ * 3600 where TZ is the difference, in hours, between your local time and UTC (Unix time is always UTC). It seems you are in Hongkong timezone, so that would make TZ = 8 (further adjustment for daylight saving may be required).
November 6, 200619 yr I have a similar need, but instead of a Timestamp result I need the results in a date field. I don't need the time, just the date. Thank you for help. Edited November 6, 200619 yr by Guest
November 6, 200619 yr Try: Div ( UnixTime + 62135596800 + TZ * 3600 ; 86400 ) + 1 Hmmmm, the result I get doesn't look very date-like. I am starting out with the value 1162837975, and I want to turn it into 11/06/2006. The calculation above returned 2588996659
November 6, 200619 yr Huh? If I plug 1162837975 in UnixTime, and -8 in TZ, I get: Div ( 1162837975 + 62135596800 - 8 * 3600 ; 86400 ) + 1 This returns 732621. If the result is Date, it will translate to Nov 6, 2006.
November 6, 200619 yr I had left out the -8 'cause I thought it wouldn't matter, but you're right that when I do the calculation again I get the number you cite. But I wasn't getting this entry formatted as a date when my script entered it, so I added the GetAsDate function, and now all is well. Thanks! GetAsDate (Div (LineItems::M_TRAN_DATE + 62135596800 -8 * 3600 ; 86400 ) + 1 )
Create an account or sign in to comment