CurrentTime: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
FabienT (talk | contribs)
No edit summary
FabienT (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 24: Line 24:


==See Also==
==See Also==
[[Time$]]
[[Time$]], [[Date$]], [[TimeComment?]]
[[Date$]]
[[TimeComment]]
[[Category:Comments]]
[[Category:Comments]]

Latest revision as of 02:46, 18 September 2026

CurrentTime$('Time Format')

Description

This command outputs the current time of day in the specified format. It is an extension of Time$, which always formats the time according to the UI culture.

Acceptable 'Time Formats' are:

  • STANDARD_12 (or STD_12) - 12-hour clock with an AM/PM suffix, such as: "3:05 PM"
  • CIVILIAN_24 (or CIV_24) - 24-hour clock with a colon separator, such as: "15:05"
  • MILITARY (or MIL) - 24-hour clock with no separator, followed by "hours", such as: "1505 hours"
  • MILITARY_SHORT (or MIL_SHORT) - 24-hour clock with no separator, such as: "1505"
  • DEFAULT, DEFAULT_CULTURE, CURRENT, CURRENT_CULTURE, or an empty string - formats the time according to the UI culture (i.e. the language used during installation), exactly as Time$ does. For US English installs this returns an AM/PM string such as: "3:05 PM"

The Time Format argument is mandatory, but it is not case sensitive. An unrecognized format will stop the post with an error, so a misspelled descriptor is reported rather than silently ignored.


Stats

ID 66
Type String
Class All Machines
Min Version 26.1.19


Notes

  • Only hours and minutes are output; there is no seconds output in any format.
  • The 12-hour format does not zero pad the hour, so times before 10 AM output as: "9:05 AM". The three 24-hour formats always zero pad both the hour and the minutes.
  • Midnight and noon follow the usual 12-hour convention: 00:05 outputs as "12:05 AM", and 12:05 outputs as "12:05 PM".
  • When posting in silent mode, or when the post is run from a script, this command outputs nothing at all and the requested Time Format is ignored. Time$ and Date$ behave the same way. Posts should therefore not assume that a time will always be present in the output, and should not rely on its presence for line numbering, block counts or fixed-width formatting.

See Also

Time$, Date$, TimeComment?