Webtags/Parameters: Difference between revisions

3,655 bytes removed ,  09:22, 3 October 2022
m
Line 180: Line 180:
Seconds are supported but may be rounded down or up to 00 (e.g. <#LastDataReadT> supports seconds, but <#LastRainTip> is reported rounded back to previous minute and <#TrrateTM> is reported rounded forward to the next minute). It is up to the user to format what he wants and adjust that format if not useful.
Seconds are supported but may be rounded down or up to 00 (e.g. <#LastDataReadT> supports seconds, but <#LastRainTip> is reported rounded back to previous minute and <#TrrateTM> is reported rounded forward to the next minute). It is up to the user to format what he wants and adjust that format if not useful.


====Dependency on Cumulus flavour====
==== Conversion from legacy Cumulus to CumulusMX ====


You have to change all date/time formatting when moving from the original (legacy) Cumulus to MX.
You have to change, at least check, all date/time formatting for Webtags you use when moving from the legacy Cumulus 1 to CumulusMX.  
 
All the tables explaining what is used in each flavour for each type of output, both by including separate columns for each flavour, and by giving examples in each flavour.
 
=====For the legacy software=====
 
I deal with this first, just because it is simple!
 
From version 1.9.1, most web-tags that report any form of time or date will accept an optional 'output format' parameter (we have already seen whether this can only affect time, only affect date, or both).
 
The legacy Cumulus uses Delphi to interpret the output modifiers:
*For most modifiers, a particular character produces the same output regardless whether the output modification specifier is in capitals or lower-case
**There is an exception, the case you use for any am/pm output format modifiers determines the case that is output.
*In general, the context of a modifier does not affect the output it produces
**Again, there is an exception, "m" or "M" has two different meanings (minutes or month) depending on context.
 
=====The complications with MX=====
 
The [[:Category:Ini Files|*.ini Files]] in MX have adopted the ISO 8601 date format where year comes first (yyyy-MM-dd), although for compatibility with the legacy software, any lines in these files ported from Cumulus 1 retain their day before month before year format until they are updated.  Most dates reported by web tags derive their content from entries in these files.
 
The [[:Category:MX txt Files|*.txt Files]] have so far stuck to date formats as used in the legacy definitions, the intention to swap to ISO format for the .txt files from September 2020, having been postponed to an unannounced future date, because of the continuing need for compatibility while there is use of the legacy software by a significant number of users.
 
For Cumulus MX output formatting,  the date and time modifiers are complicated by the fact that ''the same character can have 4 different meanings'' depending on its case (capital letter or lower-case letter), and depending on whether it is on its own (standard format) or with another modifier (custom format).  One more confusion, Microsoft have reversed the use of capital 'M' and lower case 'm' from the standard used very widely, and you may have got to know.  '''Sounds confusing?''' Well it is complicated.
 
Consider context first:
*<tt><#tag_name format=x></tt>
**If the '''x''' in the above general syntax is a single character, it represents a standard format code
**The standard characters for dates and times are defined at [https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings standard-date-and-time-format-strings]
*<tt><#tag_name format=xyz></tt>
**If the '''xyz''' in the above general syntax is replaced by two or more characters, it becomes a custom format code (combinations of characters, or single characters prefixed by %)
**The custom characters for dates and times are defined at [https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings custom-date-and-time-format-strings]
 
Consider case next:
*Cumulus MX (when running on Windows) uses the '''.NET''' software which is provided as standard by Microsoft Windows.
**".NET" was originally operating system independent, later only Microsoft Windows specific components were included, but since November 2020 ".Net" is used for an operating system independent version that originally Microsoft issued under another name!
**(actually it is possible to install and run "Mono" in Windows Operating Systems).
*If Cumulus MX is running on any Linux distribution (including Raspberry Pi Operating Systems) or Mac OS X, or any other device that uses an UNIX derived operating system, then MX uses '''Mono''' software for same purposes. (MONO is a operating system independent version of .NET, although they are developed independently, they have common origins).  


Best method probably is to migrate and look at your website or reports - wherever you use your Webtags - and check your date/time formats. Then modify where you think it is required.


====Time formats====
====Time formats====