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.

Get Current Time as HH:mm:ssZ

Featured Replies

I need to get the Current Time in UTC and reformat it to HH:mm:ssZ

I was thinking that I need to use Get ( CurrentTimeUTCMilliseconds )

Any tips?

Thanks

  • Author
7 minutes ago, bcooney said:

Yes, that's correct. Formatting is done in the Inspector palette.

Tips? Well, if you have a field holding the offset, then you can calc the local time.

http://www.filemaker.com/help/13/fmp/en/html/func_ref2.32.27.html

Thisbeing used when I'm exporting XML so currently it's a set field calc that is Global.. Not being used for any layout.

The issue with having a field to hold the offset is that would need to be changed based on the Daylight saving. 

The Get ( CurrentTimeUTCMilliseconds ) knows this info.. Just trying to get this info into a Time format. 

 

32 minutes ago, Devin said:

Thisbeing used when I'm exporting XML so currently it's a set field calc that is Global.

So why don't you set the global field to:

Let ( [
s = Int ( Mod ( Get ( CurrentTimeUTCMilliseconds ) ; 86400000 ) / 1000 )
] ;
Time ( 0 ; 0 ; s ) & "Z"
)

Note that the global field needs to be a Text field.

 

Or make the global field a Time field, format it as hh:mm:ss with a trailing "Z", and set it to:

Mod ( Get ( CurrentTimeUTCMilliseconds ) ; 86400000 ) / 1000

Then make sure you export with the option "Apply current layout’s data formatting to exported data" checked.

 

Edited by comment

  • Author

That Worked.. I have no idea what that does.. But it works.

Thanks once again Comment..

 

 

 

8 minutes ago, Devin said:

I have no idea what that does.

Well, there are 86.400,000 milliseconds in a 24-hour day. So if you divide the total number of milliseconds since 1/1/0001 by that and take the remainder, you will have the number of milliseconds elapsed since midnight today. Divide that by 1000, and the rest it trivial.

Note the edit to my answer above.

 

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.