Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

calculating unix / epoch time ?

Featured Replies

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

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

  • Author

awesome comment, thanks

  • 3 weeks later...

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

Try:

Div ( UnixTime + 62135596800 + TZ * 3600 ; 86400 ) + 1

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

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.