Page 1 of 1

Question regarding Date/Time format

Posted: Fri 05 Aug 2011 8:15 pm
by RayProudfoot
Hi Steve,

I'm trying to work out how I can change the format of any date on my all-time records page. For example, the tag for my all-time highest temperature - #TtempH - shows "at 16:19 on 02 July 2009".

I want to lose the leading zero and make it "at 16:19 on 2 July 2009". The tag appears to contain the words "at" and "on" as well as the time and date elements.

How would I add a format command to drop that leading zero but retain "at" and "on"?

LATER:

I've worked out how to change the all-time time/date formats but can't work out how to drop the leading zero on my home page where it shows the current date and time.

Re: Question regarding Date/Time format

Posted: Fri 05 Aug 2011 9:00 pm
by captzero
Hi Ray,

Most date and time tags have an optional 'format' parameter, e.g: <#YearTempHT format=hh:nn>. You can override the default display format for that item, using the format specifiers in the Cumulus help file (Cumulus help file> Creating a web site> Webtags> Parameters)

I think <#TtempH format="hh:nn on d mmmm yyyy"> should work

Cheers

Re: Question regarding Date/Time format

Posted: Fri 05 Aug 2011 9:19 pm
by RayProudfoot
Thanks Dan. I have since worked out how to change the formatting on my alltime records page.

The one I'm having problems with is the leading zero on my home page.

Conditions at local time 22:10 on Friday 05 August 2011

I tried adding a format to the #day tag to drop the leading zero but this didn't work. Here's what I changed:-

<#day format=d>

Any ideas?

Re: Question regarding Date/Time format

Posted: Sat 06 Aug 2011 12:18 am
by captzero
I would do what you have done. The help says 'Most date and/or time tags have an optional 'format' parameter' buy maybe the <#day> tag isn't one of them. Steve will know.

Re: Question regarding Date/Time format

Posted: Sat 06 Aug 2011 8:26 am
by RayProudfoot
Thanks Dan. It does look as though it isn't currently possible but I'm hopeful Steve will come to the rescue. :)

Re: Question regarding Date/Time format

Posted: Sat 06 Aug 2011 10:00 am
by steve
You say you're trying to format the <#day> tag (which doesn't have a format parameter currently), so I assume you're not using the <#time> tag (which does have a format parameter) as in the original 'standard' page. Is there any reason you can't use that?

Re: Question regarding Date/Time format

Posted: Sat 06 Aug 2011 2:42 pm
by RayProudfoot
Thanks Steve. I'm now using the time webtag and have successfully formatted it to remove the leading zero.