1,635
edits
m (→Time formats) |
|||
Line 193: | Line 193: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
!style="width:150px" | | !style="width:150px" | Mono/.NET Specifier for Cumulus MX | ||
!style="width:600px" | Displays | !style="width:600px" | Displays | ||
!style="width:600px" | Example | !style="width:600px" | Example | ||
|- | |- | ||
|%h | |%h | ||
|Displays the hour (12 hour clock) without a leading zero (1-12) | |Displays the hour (12 hour clock) without a leading zero (1-12) | ||
| 7 | | 7 | ||
|- | |- | ||
|%h ''tt'' | |%h ''tt'' | ||
|Displays the hour (12 hour clock) without a leading zero (1-12) in combination with AM/PM. | |Displays the hour (12 hour clock) without a leading zero (1-12) in combination with AM/PM. | ||
What "tt" produces depends on locale settings for your device, it might be capitals or it might be lower case (in Windows use Control Panel, not Settings app, to get to these regional additional settings). | |||
| 7 PM | |||
| | |||
|- | |- | ||
|%h:mm [''tt''] | |%h:mm [''tt''] | ||
|Displays the hour (using 12 hour clock) without a leading zero (1-12) followed by 2 digit minutes [optionally in combination with AM/PM whose case varies as explained in previous entry]. | |Displays the hour (using 12 hour clock) without a leading zero (1-12) followed by 2 digit minutes [optionally in combination with AM/PM whose case varies as explained in previous entry]. | ||
|'10:27 am' produced by <#LastDataReadT format="h:mm tt"> | |||
|'10:27 am' produced by | |||
|- | |- | ||
|%H | |%H | ||
| Displays the hour part of any duration or clock time, without a leading zero (0-23). | | Displays the hour part of any duration or clock time, without a leading zero (0-23). | ||
Note that '%' before the "H", this makes it a custom modifier, needed because H is on its own. | |||
|7 produced by | |7 produced by | ||
<#daylength format=%H> | |||
|- | |- | ||
| H:mm | | H:mm | ||
| Displays the hour part of any duration or clock time, without a leading zero (0-23) followed by 2 digit minutes for that duration or clock time. | | Displays the hour part of any duration or clock time, without a leading zero (0-23) followed by 2 digit minutes for that duration or clock time. | ||
|'6:27' or '17:49' produced by <#LastDataReadT format="H:mm"> | |'6:27' or '17:49' produced by <#LastDataReadT format="H:mm"> | ||
|- | |- | ||
|HH | |HH | ||
| Displays the hour part of any duration or clock time, using 24 hour clock with a leading zero (00-23). | | Displays the hour part of any duration or clock time, using 24 hour clock with a leading zero (00-23). | ||
|'06' or '17' produced by <#LastDataReadT format=HH> | |'06' or '17' produced by <#LastDataReadT format=HH> | ||
|- | |- | ||
|hh [''tt''] | |hh [''tt''] | ||
| Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) [optionally, if it is a clock time, in combination with am/pm]. | | Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) [optionally, if it is a clock time, in combination with am/pm]. | ||
The optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon but before midnight. | |||
|'07 am' produced by | |||
<#LastDataReadT format="hh tt"> if locale specifies lower case | |||
|'07 am' produced by | |||
|- | |- | ||
|hh:mm [''tt''] | |hh:mm [''tt''] | ||
| Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally, if it is a clock time, in combination with am/pm]. | | Displays the hour part of any duration or clock time, (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally, if it is a clock time, in combination with am/pm]. | ||
The optional 'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight | |||
|'8:27 am' produced by | |'8:27 am' produced by | ||
<#LastDataReadT format="h:mm tt"> if locale specifies lower case | |||
|- | |- | ||
|%m | |%m | ||
|Displays the minutes of any duration or clock time, without a leading zero (0-59). | |Displays the minutes of any duration or clock time, without a leading zero (0-59). | ||
As other examples show, the % is only needed when "m" is on its own. | |||
| 7 produced as a duration in minutes by | | 7 produced as a duration in minutes by | ||
<#daylength format=m> | |||
|- | |- | ||
|mm | |mm | ||
|Displays the minutes of any duration or clock time, with a leading zero (00-59). | |Displays the minutes of any duration or clock time, with a leading zero (00-59). | ||
|'07' produced as a duration in minutes by | |'07' produced as a duration in minutes by | ||
<#daylength format=mm> | |||
|- | |- | ||
|%s | |%s | ||
|Displays the seconds for any duration or clock time, that has resolution to less than a minute, without a leading zero (0-59). | |Displays the seconds for any duration or clock time, that has resolution to less than a minute, without a leading zero (0-59). | ||
| 9 produced by <#metdate format=%s> | |||
| 9 produced by <#metdate format=s> | |||
|- | |- | ||
|ss | |ss | ||
|Displays the second with a leading zero (00-59). | |Displays the second with a leading zero (00-59). | ||
|'06' or 19 produced by <#LastDataReadT format=ss> | |'06' or 19 produced by <#LastDataReadT format=ss> | ||
|- | |- | ||
|FFF | |FFF | ||
|Displays the millisecond without a leading zero | |Displays the millisecond without a leading zero. Displays either nothing or displays 1-999. So don't write any code that assumes the MX output is numeric. | ||
Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Microsoft Windows. | Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Microsoft Windows. | ||
| | | | ||
|- | |- | ||
|ff (or ''f'') | |ff (or ''f'') | ||
|Displays hundredths of a second (or tenths) with leading zero(s) | |Displays hundredths of a second (or tenths) with leading zero(s) | ||
| | | | ||
|- | |- | ||
|fff | |fff | ||
|Displays the millisecond with a leading zero (000-999). | |Displays the millisecond with a leading zero (000-999). | ||
Line 304: | Line 274: | ||
Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Microsoft Windows. | Note that the system clock (before Windows 10 64-bit systems) only has precision to 15 ms, so don't use this modifier if your Cumulus is running on an old version of Microsoft Windows. | ||
The 'fff' modifier can actually be extended to 'ffffff' for output to a millionth of a second! | |||
| 09:47:25.000' produced by | | 09:47:25.000' produced by | ||
<#time format=hh:mm:ss.fff> | |||
|- | |- | ||
| zzz | | zzz | ||
|Displays the offset of any time from UTC in hours and minutes | |Displays the offset of any time from UTC in hours and minutes | ||
| e.g.-07:00 | | e.g.-07:00 | ||
|- | |- | ||
|"h:mm K" | |"h:mm K" | ||
|Effectively another way of including time zone after a time, but it can only be used for time-zones never matching UTC (if | |Effectively another way of including time zone after a time, but it can only be used for time-zones never matching UTC (if understood correctly) | ||
|(no examples supplied yet) | |(no examples supplied yet) | ||
|- | |- | ||
|%t | |%t | ||
|Displays the time using the Short Time format. | |Displays the time using the Short Time format. | ||
Remember that 't' combined with other specifiers (or preceded by space or '%') has a different meaning - see below. | |||
| '09:47' produced by <#LastDataReadT format=t> (might not use colon in your locale) | | '09:47' produced by <#LastDataReadT format=t> (might not use colon in your locale) | ||
|- | |- | ||
|tt | |tt | ||
| | |'tt' displays the contents of the device locale setting for AM string for midnight until any hour before noon, and the contents of the PM string for noon or any hour after noon before midnight, so whether it displays in capitals or lower case is determined by the locale settings, not the case of "tt". | ||
| | |||
| | |||
|- | |- | ||
|h t | |h t | ||
|Uses the 12-hour clock for the preceding h or H (clock time) specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon. | |Uses the 12-hour clock for the preceding h or H (clock time) specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon. | ||
whether it displays the "a" or "p" in capitals or lower case is determined by the locale settings, not the case of "t". | |||
| see previous example | | see previous example | ||
|- | |- | ||
|/ | |/ | ||
|Displays the date separator character given by the Date Separator. It might not display a slash. | |Displays the date separator character given by the Date Separator. It might not display a slash. | ||
Line 354: | Line 307: | ||
|- | |- | ||
|: | |: | ||
|Displays the time separator character given by the Time Separator, this might not display a colon. | |||
|Displays the time separator character given by the Time Separator | |||
Note that by default Cumulus MX expects a locale to use ":" for any time separator. | |||
|':' for British locale | |':' for British locale | ||
|} | |} | ||
====Year formats==== | ====Year formats==== |