DateFormatStrftime ( someTimeStamp ; formatString )
Format a date/timestamp using the format defined by the POSIX/UNIX 'strftime'
Be the first to rate this function Log in to vote
Dan Shockley - Show more from this author |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
There are a bunch of useful "format some date/timestamp" functions, but I've used this for a long time. But, it is also possible to just use a long-standing set of formatting codes defined long ago by the 'strftime' POSIX shell command built into UNIX. See https://manpages.org/strftime
Most of its formatting codes are supported - see the function's documentation.
There are a few special uses:
- If you send "Help" for the 1st param, you get usage instructions, which is good when you don't remember a formatting code.
- If you send "NOW" for the 1st param, it uses the CurrentHostTimestamp, along with your format string.
- If you send "File_NOW" for the 1st param, it uses the CurrentHostTimestamp and you can leave the formatString empty. It will format a timestamp that works within a filename on any OS platform (no slashes or colons), in an ISO8601-style format.
- If you send "File_AsNum_NOW" for the 1st param, it uses the CurrentHostTimestamp and you can leave the formatString empty. It will format a timestamp that works within a filename on any OS platform (no slashes or colons), but specifically with no punctuation, just numbers.
- If you send "File_AsDateLine_NOW" for the 1st param, it uses the CurrentHostTimestamp and you can leave the formatString empty. It will format a timestamp as a simple dateline like you'd see in a news article.
- If you send "File_Friendly_NOW" for the 1st param, it uses the CurrentHostTimestamp and you can leave the formatString empty. It will format a timestamp that works within a filename on any OS platform (no slashes or colons), in a human-friendly format.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.