K3 Documents

Date to String with Formatting

Updated on

Copy and Paste the following formula using your data where necessary.

Description: 

Formatting Object to String in format YYYYMMDD (NOTE: Date Field or any second param passed to String.format must be an array i.e. "new Date []")

String.format("%1$tY%1$tm%1$td", new Date[] {{Date Field}})
Click to copy

Description: 

Formatting Object to String in format HH:MM:SS (NOTE: Date Field or any second param passed to String.format must be an array i.e. "new Date []")

String.format("%1$tH:%1$tM:%1$tS", new Date[] {{Date Field}})
Click to copy
Previous Article Days Between Two Dates
Next Article Cast to Integer