Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6653 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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).

  • 3 weeks later...
Posted (edited)

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 by Guest
Posted

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

Posted

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.

Posted

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 )

This topic is 6653 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.