Jump to content

Get Current Time as HH:mm:ssZ


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

Recommended Posts

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. 

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This topic is 2774 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.