ConvertTimestampToUTC ( inputTS )
Used to convert a given FileMaker timestamp to a ISO8601 Timestamp format
Average rating: 5.0 (1 vote) Log in to vote
Robert D Trammel - Show more from this author
https://www.linkedin.com/in/robertdtrammel/ |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
The goal of this function is that you can give it a timestamp, and it will give you the UTC version of that timestamp. I don't want to have to write this calculation ever again. So I'm sharing it with you all. This will calculate your timezone modifier, apply it to the given timestamp, and then format it in ISO 8601 format. This comes in handy primarily when working with web api's from FileMaker without using some kind of web viewer to format the date. If you have ideas for improvements or a better way of doing it, please let me know in the comments.
NOTE: If you just want the FileMaker date in UTC without converting to ISO 8601, you can just do this.
Let([
modifier = GetAsTime( Get( CurrentHostTimestamp ) - GetAsTimestamp( Get( CurrentTimeUTCMilliseconds ) / 1000 ) );
];
GetAsTimestamp( inputTS + modifier )
)
I hope this helps someone. Thanks.
Comments
Robert D Trammel Oct 22, 2024 |
||
Or even without a let statement: GetAsTimestamp( inputTS + ( GetAsTime( Get( CurrentHostTimestamp ) - GetAsTimestamp( Get( CurrentTimeUTCMilliseconds ) / 1000 ) ) ) ) |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.