1,873
edits
m (→Month formats) |
|||
(10 intermediate revisions by the same user not shown) | |||
# Next check [[#Which tag names take date/time output formatting modifiers|the next paragraph]] to see if that tag accepts both time and date modifiers
# If your tag name does accept both date and time modifiers, simply modify the web tag as shown here <code><#tag_name format="yyyy-MM-dd HH:mm:ss"></code> where tag_name is set from step 1, but all the rest is typed as shown.
# To explain each element in that format value, look in [[#Time formats|Time formats]], [[#Year formats|Year formats]], [[#Month formats|Month formats]], [[#Day formats|Day formats]], [[#Use of spaces|Use of spaces]], [[#Including literals in format parameters|Including literals in format parameters]].
Should you want a different date/time format, then the sub-sections just referenced should help you to select a different arrangement, although there are some more options in [[#Date formats]].
All locales offer both numerical and alphabetical formats for representing a day.
The table below
▲The table below is the definitive guide to how to ensure you do specify just the day part of any date specifications.
{| class="wikitable" border="1"
|-
!style="width:150px" |
!style="width:600px" | Displays
!style="width:600px" | Example
|-
| d (single character)▼
| %d
|Displays the day as a number without a leading zero (1-31).
|
|-
|dd
|Displays the day as a number with a leading zero (01-31).
|07 produced by <#metdate format="dd">
|-
|ddd
|Displays the day as an abbreviation
|'Wed' produced by <#metdate format="ddd"> (UK English locale)
|-
|dddd
|Displays the day as a full name
|'Friday' produced by <#metdate format="dddd"> (English locale)
|}
====Date formats====
The [[#Year formats|Year formats]], [[#Month formats|Month formats]], and [[#Day formats|Day formats]] listed above can be combined to make up a date output modifier, but there are some other modifiers available that can produce whole dates.
The [[#Locales|locale]] will define a
If you are in the USA, Cumulus will only use your month first date internally for the start date (see [[Cumulus.ini
{| class="wikitable" border="1"
|-
!style="width:150px" |
!style="width:600px" | Displays
!style="width:600px" | Example
|-
|
| 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.
| '22/03/2019 09:47:25' produced by
▲| 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 [[File:Badge v1.png]]<#time format=c>[[File:Badge vMx.png]]<#time format=G>
|-
| ddddd
▲| 'ddddd' will output the date using the format given by the Short Date format.
|
|-
|D▼
|Displays the date using the format given by the Long Date format.
▲|e.g. '22 March 2020' (British Locale)
|-▼
▲|D
|-
|M
|Day of month followed by Month name.
|
|-
|"MMMM
|
| July 4 (USA format
|Displays the time using the '''Long Time format'''. ▼
[[File:Badge vMx.png]] Note that this is a full time specifier and "T" is on its own as we are using a single character format.▼
|'09:47:56' (might not use colon in your locale) produced by ▼
|}
====Time formats====
Here context matters, so both standard (single character) and custom (two or more characters) formats are shown in the following table. As explained earlier, time formats can be used with both time-duration reporting and clock time reporting.
!style="width:600px" | Displays
!style="width:600px" | Example
▲|-
▲|Displays the time using the '''Long Time format'''.
▲
▲|'09:47:56' (might not use colon in your locale) produced by <#LastDataReadT format=T>
|-
|%h
|}
==== Literals
If you are considering use of literals (such as a space) within a output format modifier in a script, '''then don't'''.
Instead include whatever precedes the literal in a tag specification, then concatenate on the literal, and finally concatenate another tag specification for whatever is to follow the literal.
An '''example''' to make this clearer is <code>$MXDateTime = '<#date format=yyyy-MM-dd>' . 'T' . '<#time format=hh:mm:ss>';</code>, which is written in PHP Hypertext Pre-processor format, the literal 'T' has been inserted by using two separate web tags surrounding the literal. The same approach applies if you wanted to replace that "T" with a space.
NOTE: the same string is actually created by <code>$MXDateTime = '<#date format=s>'</code>.
The reason is preventing complex mixup of single and double quotes between the script language and CumulusMX.
====Use of spaces====
|