Webtags (preserving history): Difference between revisions

m
Line 333: Line 333:


[[File:Badge vMx.png]]Note for MX - you can use single quotation marks round spaces and text (e.g. ' on '), but you can also use '\' as escape character (e.g. for 'on' use '''\o\n''').  However for 'at' the only alternative is '''\a't''''  because the character t has another meaning and escape followed by a t becomes a tab!
[[File:Badge vMx.png]]Note for MX - you can use single quotation marks round spaces and text (e.g. ' on '), but you can also use '\' as escape character (e.g. for 'on' use '''\o\n''').  However for 'at' the only alternative is '''\a't''''  because the character t has another meaning and escape followed by a t becomes a tab!
=== List of allowed modifiers for output format parameters ===
Note for Cumulus 1 - where lower (or upper, for easier comparison with MX) case shown, because Delphi is case insensitive, upper (or lower) case (in some cases, indicated by use of curved brackets) could be used instead (exceptions: a/p, ampm, am/pm, Am/Pm, AM/PM, A/P, AMPM etc display as input).
[[File:Badge vMx.png]]Remember that most single character format specifiers have a different meaning to when the same letter appears in a multi-character format.
==== Forum reference ====
For official full details see [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=17888 Cumulus MX forum], the following table is revised for simplicity. (I've given a different selection of combinations and included '%' where necessary to avoid single character versus custom complications).
==== My Revised Table of Time and Date Output Modifiers ====
In some rows of this table, square brackets [] indicate optional items, they are included just to make it clearer how items can be combined in a single output parameter.
{| class="wikitable" border="1"
|-
!style="width:150px" | {{Version badge 1}}Delphi Specifier for Cumulus 1.9.x
!style="width:150px" | [[File:Badge vMx.png]]Mono/.NET Specifier for Cumulus MX
!style="width:600px" | Displays
!style="width:600px" | Example
|-
|c
|G
|Displays the date using the format given by the Short Date format, followed by the time using the format given by the Long Time format. The time is not displayed in Cumulus 1 if the date-time value indicates midnight precisely.
|'22/03/2019 09:47:25' produced by {{Version badge 1}}<#time format=c>[[File:Badge vMx.png]]<#time format=G>
|-
|d
|%d
|Displays the day as a number without a leading zero (1-31). [[File:Badge vMx.png]]Note that Cumulus MX requires a ' ' (space), '%' or other modifier to be included, as 'd' on its own returns full 'short date').
|27 produced by {{Version badge 1}}<#metdate format="d">[[File:Badge vMx.png]]<#metdate format="%d">
|-
|dd
|dd
|Displays the day as a number with a leading zero (01-31).
|07 produced by <#metdate format="dd">
|-
|ddd
|ddd
|Displays the day as an abbreviation (Sun-Sat) using the strings appropriate to the Locale.
|'Wed' produced by <#metdate format="ddd"> (English locale)
|-
|dddd
|dddd
|Displays the day as a full name (Sunday-Saturday) using the strings appropriate to the Locale.
|'Friday' produced by <#metdate format="dddd"> (English locale)
|-
|ddddd
|d (as single character format)
|Displays the date using the format given by the Short Date format.
|e.g. '22/03/2019' (British Locale)
|-
|dddddd
|D
|Displays the date using the format given by the Long Date format.
|e.g. '22 March 2020' (British Locale)
|-
|M (or ''m'')
|%M
|Displays the month as a number without a leading zero (1-12).
*{{Version badge 1}}Cumulus 1.x.y:If the 'M' or 'm' specifier immediately follows an h, hh, HH, or H specifier, the minute rather than the month is displayed.
*[[File:Badge vMx.png]]Cumulus MX: Note that including a ' ' (space) or '%' before the M makes it a custom modifier e.g. '7' is returned for July as any initial zero is suppressed. ('M' on its own returns both Month and Day according to local format e.g. 22 July).
|2
|-
|MM (or ''mm'')
|MM
|Displays the month as a number with a leading zero (01-12).
*{{Version badge 1}}Cumulus 1.x.y:If the 'm' or 'M' specifier immediately follows an h, H, HH, or hh specifier, the minute rather than the month is displayed.
|'03' produced by <#LastDataReadT format=MM>
|-
|MMM (or ''mmm'')
|MMM
|Displays the month as an abbreviation (Jan-Dec) using the strings appropriate to the Locale.produced by <#metdate format="MM">
|'Jun' produced by <#metdate format="MMM"> (English locale)
|-
|MMMM (or ''mmmm'')
|MMMM
|Displays the month as a full name (January-December) using the strings appropriate to the Locale.
|'June' produced by <#metdate format="MMMM"> (English locale)
|-
|yy
|yy
|Displays the year as a two-digit number (00-99).
|19 produced by <#LastDataReadT format=yy>
|-
|yyyy
|yyyy
|Displays the year as a four-digit number (0000-9999).
|2019 produced by <#LastDataReadT format=yyyy>
|-
|h [''AM/PM'']
|h [''tt'']
|Displays the hour (12 hour clock) without a leading zero (1-12) [optionally 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).
{{Version badge 1}}For Cumulus 1 the formats for am/pm depend on the case in which you type the parameter as shown later in this table
|-
|h:mm (or ''h:nn'') [''AM/PM'']
|h:mm [''tt'']
|Displays the hour (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].
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when appearing in combination with 'h'
|'10:27 am' produced by {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|H (or ''H'')
|%H
|Displays the hour using 24 hour clock without a leading zero (0-23). [[File:Badge vMx.png]]Note that % is only needed when H is on its own.
|7 produced by {{Version badge 1}}<#daylength format=H>
[[File:Badge vMx.png]]<#daylength format=%H>
|-
|H:mm (or ''H:nn'')
|H:mm
|Displays the hour using 24 hour clock without a leading zero (0-23) followed by 2 digit minutes. [[File:Badge vMx.png]]Note that % is not needed when H is not on its own.
|'7:27' produced by <#LastDataReadT format="H:mm">
|-
|HH (or ''hh'')
|HH
|Displays the hour using 24 hour clock with a leading zero (00-23).
|'06' or 19 produced by <#LastDataReadT format=HH>
|-
|hh (''am/pm'')
|hh [''tt'']
|Displays the hour (12 hour clock) with a leading zero (01-12) [optionally in combination with am/pm].
{{Version badge 1}}For Cumulus 1 the case output for the optional 'am/pm' depends on the case used for that parameter as shown later in this table
[[File:Badge vMx.png]] For MX, 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
|'07 am' produced by {{Version badge 1}} <#LastDataReadT format="hh am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="hh tt">
|-
|hh:mm (or ''hh:nn'') [''am/pm'']
|hh:mm [''tt'']
|Displays the hour (12 hour clock) with a leading zero (01-12) followed by 2 digit minutes [optionally in combination with am/pm].
{{Version badge 1}}For Cumulus 1, the minutes can be represented by 'mm' only when in combination with 'h', in other contexts 'mm' is interpreted as month number, and the case output for am/pm depends on the case used for that parameter as shown later in this table
[[File:Badge vMx.png]] For MX, 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 {{Version badge 1}} <#LastDataReadT format="h:nn am/pm">[[File:Badge vMx.png]] <#LastDataReadT format="h:mm tt">
|-
|n
|m
|Displays the minute without a leading zero (0-59).
|7 produced by {{Version badge 1}}<#daylength format=n>[[File:Badge vMx.png]]<#daylength format=m>
|-
|nn
|mm
|Displays the minute with a leading zero (00-59).
|'07' produced by {{Version badge 1}}<#daylength format=nn>[[File:Badge vMx.png]]<#daylength format=mm>
|-
|s
|s
|Displays the second without a leading zero (0-59).
|-
|ss
|ss
|Displays the second with a leading zero (00-59).
|'06' or 19 produced by <#LastDataReadT format=ss>
|-
|z
|FFF
|Displays the millisecond without a leading zero (Cumulus 1:0-999, Cumulus MX: nothing, or 1-999). Note that the system clock in some versions of Windows only has precision to 15 ms.
|
|-
|(not available)
|ff (or ''f'')
|Displays hundredths of a second (or tenths) with leading zero(s)
|
|-
|zzz
|fff
|Displays the millisecond with a leading zero (000-999). Note that the system clock in some versions of Windows only has precision to 15 ms, so requesting thousandths of a second may not return anything useful. The 'fff' modifier can actually be extended to 'ffffff' for a millionth of a second!
|
|-
|t
|t
|Displays the time using the Short Time format.  [[File:Badge vMx.png]]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) for both flavours of Cumulus
|-
|TT
|T
|Displays the time using the Long Time format.
|'09:47:56'  (might not use colon in your locale) produced by {{Version badge 1}}<#LastDataReadT format=TT> [[File:Badge vMx.png]]<#LastDataReadT format=T>
|-
|am/pm or Am/Pm or AM/PM
|tt
|{{Version badge 1}}Uses the 12-hour clock for the preceding h or H specifier, and displays 'am' for any hour from midnight until just before noon, and 'pm' for any hour from noon onwards. The am/pm specifier for Cumulus 1 can use lower, upper, or mixed case, and the result is displayed accordingly.
[[File:Badge vMx.png]] For MX, '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
| {Version badge 1}} 'am' produced by <#LastDataReadT format=am/pm>, 'AM' produced by <#LastDataReadT format=AM/PM>
|-
|a/p
|t
|Uses the 12-hour clock for the preceding h or H specifier, and displays 'a' for any hour from midnight until before noon, and 'p' for noon or any hour after noon.
{{Version badge 1} The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
[[File:Badge vMx.png]]Remember that 't' has to be combined with other specifiers (or preceded by space or '%') to display 'a' or 'p' as if it is alone it has a different (short format time) meaning - see above.
| see previous example
|-
|ampm
|(see above for 12 hour formats)
|This 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.
{{Version badge 1}Uses the 12-hour clock for the preceding h or H specifier
| see previous examples
|-
|/
|/
|Displays the date separator character given by the Date Separator. It might not display a slash.
| '/' for British locale
|-
|:
|:
|Displays the time separator character given by the Time Separator. It might not display a colon.
|':' for British locale
|-
|'xy'
|'xy' or ''\x\y''
|Characters enclosed in single quotation marks are displayed as such, and do not affect formatting. In MX each character to be displayed as it was typed can be prefixed by a backslash.
|Hypens are added in this PHP language example  '<#LastDataReadT format=yyyy>'.'-'.'<#LastDataReadT format=MM>'.'-'.'<#LastDataReadT format="dd">'
|}
=The Web Tags for Cumulus =
These are available in both Cumulus 1 and MX unless indicated by a version 1 or MX badge.
Here follow tables indicating what web tags/tokens can be used, tables group the tags/tokens by the basic purpose of the tags listed.


===System===
===System===
5,838

edits