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.

Time zone query

Featured Replies

Hi.

This is not strictly an FMS question, but...

I have two sites accessing a server - all three are in different time zones in Australia. As certain transactions are made in the database, a log entry is sent back to a log table on the server which - in itself - works fine. The problem I am having is that the server records it's own time which will differ from that of the client. Sure, I can send the timestamp of the client event t to the log rather than using the record_created timestamp of the server, but then the log will be out of sequence depending on the difference of the time zones.

The advantage to date of using the server's record_created time stamp is that is is in order, but doesn't reflect that of the client date and time.

Has anybody got any bright ideas as to how I could manage this a little better?

Cheers,

Greg

Keep a record of BOTH server and client times for creation time.

When I have to do this, I just add the time difference.

  • Author

Thanks IdealData - I could do that, but would still have to do some translation of events. I guess I was looking for something like a routine that knew about time zones and could interpret them.

Agnes. I thought about that, but with daylight saving, the time zones change twice a year.

I thank you both for your input - I will work with both ideas.

Cheers,

Greg

All I can suggest is an auto-enter with Get ( CurrentHostTimeStamp ) to log the client actions on the client side. At any time you can convert that time to determine client's actual time. If you normalize the systems to the server first then there will be no conflict. A calc can convert for their display.

Edited by LaRetta

FileMaker 12 has an undocumented Get ( UTCmSecs ) function. You can use GetAsTimestamp ( Get ( UTCmSecs ) / 1000 ) to enter UTC (or the closest approximation to UTC that the creating device can muster), which will take account of a device's time zone. (I haven't tested how it behaves if the clock or time zone settings on a device are incorrect.) You can use this to either calculate a different time for the log or to derive the time zone of each client. The trouble with Get ( UTCmSecs ) is that, as an undocumented function, we don't know that it will continue to work in future updates and versions. If you like it as much as I do, put in a feature request to either keep Get ( UTCmSecs ) or give us a working substitute.

  • 2 years later...

I run over a cool triick

 

use a applescript to write the UTC timezone into your file. 

 

 set timeZone to do shell script "date +%z"

set numero to timeZone as number
set nreal to numero / 100
set inteiro to nreal as integer
tell application "FileMaker Pro Advanced"
tell document "YOUR FILE"
tell current layout
tell current record
set cell "YOUR TIMEZONE FIELD" to inteiro
end tell
end tell
end tell
end tell

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.