Devin Posted September 15, 2016 Posted September 15, 2016 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
Lee Smith Posted September 15, 2016 Posted September 15, 2016 Did you look at Brian Dunning’s site for a Custom Function? I kind of remember one for this. http://www.briandunning.com/filemaker-custom-functions/recentlist.php
bcooney Posted September 15, 2016 Posted September 15, 2016 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
Devin Posted September 15, 2016 Author Posted September 15, 2016 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.
comment Posted September 15, 2016 Posted September 15, 2016 (edited) 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 September 15, 2016 by comment
Devin Posted September 15, 2016 Author Posted September 15, 2016 That Worked.. I have no idea what that does.. But it works. Thanks once again Comment..
comment Posted September 15, 2016 Posted September 15, 2016 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.
Recommended Posts
This topic is 3083 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 accountSign in
Already have an account? Sign in here.
Sign In Now