Page 1 of 1

Format timestamps **solved**

Posted: Tue Jun 02, 2015 5:58 pm
by ajlacy
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

Posted: Wed Jun 03, 2015 11:39 am
by wvdkuil
ajlacy 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?
Maybe this is what you needhttp://meteobridge.com/wiki/index.php/Templates
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

Posted: Thu Jun 04, 2015 8:08 pm
by ajlacy
That works, I never thought to look at the decimal section to see how to format dates. It is cumbersome but it works.