Explore more
Functions
Tokens for date/time formatting
3min
use date/time formatting tokens to change the format of date/time data for example, you can convert a timestamp to a quarter of the year or day of the week the following tables present the tokens supported for changes in formatting year, month, and day tokens token output description yy 70 71 29 30 2 digit year yyyy 1970 1971 2029 2030 4 digit year y 1970 1971 9999 +10000 +10001 year with any number of digits and sign q 1 2 3 4 quarter of year qo 1st 2nd 3rd 4th quarter of year with ordinal m 1 2 11 12 month number mo 1st 2nd 11th 12th month with ordinal mm 01 02 11 12 month number with leading zero mmm jan feb nov dec month abbreviation mmmm january february november december month name d 1 2 30 31 day of month do 1st 2nd 30th 31st day of month with ordinal dd 01 02 30 31 day of month with leading zero ddd 1 2 364 365 day of year dddo 1st 2nd 364th 365th day of year with ordinal dddd 001 002 364 365 day of year with leading zero week year, week, and weekday tokens token output description d 0 1 5 6 day of week do 0th 1st 5th 6th day of week with ordinal dd su mo fr sa day abbreviation ddd sun mon fri sat day abbreviation dddd sunday monday friday saturday day name e 1 2 6 7 day of week (iso) w 1 2 52 53 week of year wo 1st 2nd 52nd 53rd week of year with ordinal ww 01 02 52 53 week of year with leading zero w 1 2 52 53 week of year (iso) wo 1st 2nd 52nd 53rd week of year with ordinal (iso) ww 01 02 52 53 week of year with leading zero (iso) gg 70 71 29 30 week year gggg 1970 1971 2029 2030 week year gg 70 71 29 30 week year (iso gggg 1970 1971 2029 2030 week year (iso) hour, minute, second, millisecond, and offset tokens token output description h 0 1 22 23 24 hour time hh 00 01 22 23 24 hour time with leading zero h 1 2 11 12 12 hour time hh 01 02 11 12 12 hour time with leading zero k 1 2 23 24 24 hour time kk 01 02 23 24 24 hour time with leading zero a am pm post or ante meridiem (upper case) a am pm post or ante meridiem (lower case) m 0 1 58 59 minutes mm 00 01 58 59 minutes with leading zero s 0 1 58 59 seconds ss 00 01 58 59 seconds with leading zero s 0 1 8 9 fractional seconds ss 00 01 98 99 fractional seconds with leading zero sss 000 001 998 999 fractional seconds with two leading zeros ssss sssssssss 000\[0 ] 001\[0 ] 998\[0 ] 999\[0 ] fractional seconds z 07 00 06 00 +06 00 +07 00 time zone zz 0700 0600 +0600 +0700 time zone x 1360013296 unix timestamp x 1360013296123 unix millisecond timestamp