FMtoISO8601 ( FMTimestamp )
Converts a FileMaker timestamp to ISO 8601 YYYY-MM-DDTHH:MM:SS
Be the first to rate this function Log in to vote
David A Sullivan - Show more from this author
Mandelbrot LLC http://mandelbrotllc.com |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
A lot of javascript libraries need ISO 8601 formatted timestamps.
While it makes sense to a lot of JavaScript developers, formating your dates with the largest unit of time first (years), then descending down to the smallest unit (seconds), it sure does confuse users.
So, with this custom function, you can take a typical FileMaker timestamp like this:
3/11/2021 11:23:50 AM
And make it look like this:
2021-03-11T11:23:50
Comments
flusheDData, n/a Apr 20, 2021 |
||
Hi, To make sure the length of each element is two characters long you may use the Right function. Year ( FMTimestamp ) & "-" & Right ( "00" & Month ( FMTimestamp ) ; 2 ) & "-" & Right ( "00" & Day ( FMTimestamp ) ; 2 ) & "T" & Right ( "00" & Hour ( FMTimestamp ) ; 2 ) & ":" & Right ( "00" & Minute ( FMTimestamp ) ; 2 ) & ":" & Right ( "00" & Seconds ( FMTImestamp ) ; 2 ) Best regards, |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.