Webtags (preserving history): Difference between revisions

m
→‎Date & Time: change order of entries
m (→‎Date & Time: change order of entries)
Line 862: Line 862:


==Date & Time==
==Date & Time==
Both Cumulus 1 and MX support all of these, most of these web tags can be used with output parameters.
Both Cumulus 1 and MX support all of these, except where marked as MX only, most of these web tags can be used with output parameters.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 869: Line 869:
|-
|-
|<#date>
|<#date>
|The current date
|The current date - format depends on locale you use to run Cumulus
|-
|<#metdate>
|The current meteorological date. The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date> (above), but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#date>, but with a different default format.
**Between midnight and 9am/10am the <#metdate> will return the date associated with previous calendar day, but will still return current time 
 
{{Version badge 1}}Can be used with relevant format parameters to [[Customised templates|customise]] '''todayT.htm''' template page to display current meteorological day, to customise '''thismonthT.htm''' template page to display meteorological month, and to customise '''thisyearT.htm''' template page to display correct meteorological year. This will be particularly useful on first and last day of month/year when rollover happens at 9 (or 10) a.m. and the month (and maybe year) is different before and after rollover.
 
[[File:Badge vMx.png]] Earlier MX releases provide a similar web template set, so these can be customised in same way as for legacy Cumulus above (but note capital "M" must be used for any month formatting). From release 3.10.1 the supplied web pages are web server based, there are no web templates to customise, and the supplied '''.json files''' do not include any meteorological date functionality.
|-
|<#timeUTC>
|The current UTC date/time rather than local date/time.  Example result (actual format depends on locale settings): 18:30 on 30 December 2009. If you want the local date and time, use next tag (below).
|-
|-
|<#time>
|<#time>
|The current time and date. Example result: 18:30 on 30 December 2009.  If you simply wish the time, use next tag (below)
|The current time and date. Example result (actual format depends on locale settings): 18:30 on 30 December 2009.  If you simply wish the time, use next tag (below).
|-
|-
|<#timehhmmss>
|<#timehhmmss>
|The current time. Example format: 18:30:27  
|The current time (without date). Example format: 18:30:27. You can use output format specifiers to change the way the time is output, but any date specifiers are ignored.
|-
|<#timeUTC>
|The current UTC date/time rather than local date/time
|-
|-
|<#minute>
|<#minute>
Line 890: Line 901:
|-
|-
|<#dayname>
|<#dayname>
| The current day as a word.  For example, Monday
| The current day as a word.  For example, Monday (actual format depends on locale settings)
|-
|-
|<#shortdayname>
|<#shortdayname>
Line 910: Line 921:
|The current year as a 2-digit number. Example format: 09
|The current year as a 2-digit number. Example format: 09
|-
|-
|<#metdate>
|<#rollovertime>
|The current meteorological date. After rollover time on current calendar date, this date will be the same as the current date. If using a 9am/10am rollover, then between midnight and 9am/10am the <#metdate> will be the previous calendar day
|The time that the logs rollover to the next day: 'Midnight', '9 am' or '10 am'


Can be used with relevant format parameters to indicate current meteorological day on todayT.htm template page, meteorological month on thismonthT.htm template page, or meteorological year on thisyearT.htm template page
PHP code example for testing whether before or after rollover given in next entry.
|-
|-
|<#metdateyesterday>
|<#metdateyesterday>
|The previous meteorological date. If using a 9am/10am rollover, then between midnight and 9am/10am the <#metdateyesterday> will be the calendar day before that returned by <#yesterday>, otherwise both return same.   
|The previous meteorological date. The default format depends on the locale you use to run Cumulus
*If you use midnight rollover, this returns same date as <#date>, but with a different default format.
*If using a 9am/10am rollover:
**After rollover time on current calendar date,  this is same as <#yesterday> (below), but with a different default format.
**Between midnight and 9am/10am the date output by <#metdateyesterday> will be the calendar day before that returned by <#yesterday>, but the time returned is actual local time.   


Can be used with relevant format parameters to indicate correct day on yesterdayT.htm template page, and can be used to return latest day stored on [[dayfile.txt]] and NOAA report for latest month.
Can be used with relevant format parameters to indicate correct day on yesterdayT.htm template page, and can be used to return latest day stored on [[dayfile.txt]] and NOAA report for latest month.
if you use PHP Hypertext preprocessor, you can output different text for before and after rollover, e.g.
<pre><?php
if('<#yesterday format=dddd>' == '<#metdateyesterday format=dddd>') echo '(calendar date and meteorological date same)';
else echo 'rollover still to happen, these results will be treated as belonging to <#metdate format=dddd>'; {
</pre>
|-
|-
|<#yesterday>
|<#yesterday>
|Yesterdays date
|Yesterday's dateThe default format depends on the locale you use to run Cumulus
|-
|<#rollovertime>
|The time that the logs rollover to the next day: 'Midnight', '9 am' or '10 am'
|-
|-
|<#update>
|<#update>
|The date and time of the last web site update
|The date and time of the last web site update.  The default format depends on the locale you use to run Cumulus
|-
|-
|<#timeJavaScript>
|<#timeJavaScript>
5,838

edits