Page 1 of 1

dayofyear for html-templares

Posted: Fri May 01, 2015 1:51 pm
by Andreas RD
For calculating average values or balances it would be great to get the number of the actual 'day of the year'.
e.g.:
<data timeframe="actual">
<item sensor="date0" cat="dayofyear" unit="utc">120</item> (e.g. for 30th April this year)

For instance multiplying (math function in meteohub) the average solar radiation of the current year with the 'dayofyear' to get the sum of the solar radiation up to now.

Andreas

Re: dayofyear for html-templares

Posted: Mon May 11, 2015 8:44 pm
by meteo-bures
Hello,

With PHP, you can use the "z" format parameter :

echo date("z") give the day of the year for the current date.

Hope this help ;-)

Re: dayofyear for html-templares

Posted: Wed May 13, 2015 5:16 pm
by Andreas RD
Thanks Bruno,

I will try.

Best regards, Andreas