Format timestamps **solved**
Moderator: Mattk
Format timestamps **solved**
I am using the Push Services to send an email "on day change" to have the indoor and outdoor min and max temperatures for the previous day. It is working fine except that I also want to include the timestamp of when the extremes happened. But while I see how to format the current date/time. I don't see a method for any other timestamps. Is there a method that I just don't see?
Re: Format timestamps
Maybe this is what you needhttp://meteobridge.com/wiki/index.php/Templatesajlacy wrote:I am using the Push Services to send an email "on day change" to have the indoor and outdoor min and max temperatures for the previous day. It is working fine except that I also want to include the timestamp of when the extremes happened. But while I see how to format the current date/time. I don't see a method for any other timestamps. Is there a method that I just don't see?
Decimals
. . .
When variable returns a string instead of a number (in case of a timestamp for example), "decimal" specification does have a different format and meaning, which allows to select a substring. Specification of the substring consists of two lower-case letters. The first one specifies start point of the substring, second leter the position of last character of the string to be reported. For example, when string is timestamp "20130303121055" a specification of ".ad" selects a substring from first character (position code "a") until fourth character (position code "d").
When you want to grab the time for lowest outdoor temperature of today the template for that will be [th0temp-dmintime.ij:--]:[th0temp-dmintime.kl:--]. "ij" selects the hour part at position 9-10 and "kl" selects minute part at position 11-12 of the timestamp.
Re: Format timestamps
That works, I never thought to look at the decimal section to see how to format dates. It is cumbersome but it works.