aa_macro syntax 
 aa_macro source 
 HTML source 
 HTML render 
Key

§ 4.161 - [tformat] Built-In

Mnemonic aid: tformat for TIME FORMAT

See also: [ampm] ,  [date] ,  [datetime] ,  [ddelta] ,  [month] ,  [striptime] ,  [ths] ,  [time] ,  [twelve]  and  [tz] 

 [tformat]  formats full time strings, such as those returned by  [datetime]  and  [tz] .

The first parameter is the datetime value to be formatted, either 12 or 14 digits, not counting spaces, colons or dashes.

Caution:When supplying a time string of 14 digits, only the seconds (in the SS position) may be omitted.

The second parameter is a format string, always 17 characters. For the first 14 characters, dashes (-- or ----) instead of the string value placeholders such as MM or yyyy mean "don't output this portion."

The 15th and 16th characters, designated "AP", must be either "12" or "24" to specify how hours are treated, regardless of whether the format string allows hours output.

The 17th character must be either "-" or "@". If "@", then the time will be prefixed with the word "at"; if set to "-", no "at" will appear. Also, "at" can only appear if the year, month, or day output(s), and the hours output, are also enabled by the format string.

This formatting mechanism provides good flexibility, including some less useful formats such as only the year and the hour.

Tip:You must allow hours and minutes output if you want seconds output.

[tformat datetime|yyyyMMddHHmmSSAP]

[local t 20230304130907]
[tformat [v t]|yyyyMMddHHmmSS24-]
[tformat [v t]|yyyyMMddHHmmSS12@]
[tformat [v t]|--------HHmm--12@]
[tformat [datetime]|yyyyMMddHHmmSS12@] - time this page was generated

March 4th, 2023 13:09:07
March 4th, 2023 at 1:09:07 PM
1:09 PM
February 9th, 2026 at 11:05:28 PM - time this page was generated
March 4th, 2023 13:09:07 March 4th, 2023 at 1:09:07 PM 1:09 PM February 9th, 2026 at 11:05:28 PM - time this page was generated

Other built-ins used here:  [local]  and  [v] 

Keyboard Navigation
, Previous Page . Next Page t TOC i Index
This manual was generated with wtfm
on February 9th, 2026 at 23:05 MT
wtfm uses aa_macrov3 and SqLite
aa_macrov3 uses Python 2.7