Question on time & date variables

Moderator: Mattk

Post Reply
evk
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Thu Mar 11, 2010 1:39 pm
Location: Latina, Italy

Question on time & date variables

Post by evk »

Hi all,
I'm working to make an "almanac" page on my web page.
I need help to make html code (or xml?):unsure:
to view someting like (for example):
"Today Max Pressure= 1013.1mb at 00:58 (01.04.10)"

The variable "day1_thb1_pressmax_time" contains this string "20100405225755" :ohmy: but I don't know how to divide the Date from the Hours.
Can someone reply with a piece of code to explain the method?
Thanks in advance....
Giuseppe
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Question on time & date variables

Post by skyewright »

evk wrote:The variable "day1_thb1_pressmax_time" contains this string "20100405225755" :ohmy: but I don't know how to divide the Date from the Hours.
You can use the # feature of Meteohub HTMP Templates to split out parts of the date, as described in section 3.4 of the manual.

e.g. if [actual_localdate#AH] is 20100405235900 then

[actual_localdate#AD] gives 2010 (the year)

[actual_localdate#EF] gives 04 (the month)

[actual_localdate#GH] gives 05 (the day)

[actual_localdate#IJ] gives 23 (the hour)

[actual_localdate#KL] gives 59 (the minute)

Does that make sense?
evk
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Thu Mar 11, 2010 1:39 pm
Location: Latina, Italy

Re:Question on time & date variables

Post by evk »

Hi skyewright,
Yes...it make sense!!;)
In the next hours I will try to make a web page.
Thanks, for your help.
Giuseppe
evk
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Thu Mar 11, 2010 1:39 pm
Location: Latina, Italy

Re:Question on time & date variables

Post by evk »

Hi,
this is the first result of my new almanac page:
Is in Italian,
http://www.latinacittameteo.altervista. ... nacco.html
Any comment is apreciated.
Ciao
Giuseppe
Post Reply