I'm working on receaving a xml-feed from World Weather Online... Works great. But I would like to show the observation time as 24-hour clock and not - as is send to me - as 12-hour clock.
If .NET can convert the content of @date to a DateTime, that should work. You might have to remember selecting a culture that uses 24-hours. This can be done in the Content tree, manage hostnames etc.
Hope this helps, if not, let me know and I'll be a bit more specific.
Convert 12-hour clock to 24-hour
I'm working on receaving a xml-feed from World Weather Online... Works great. But I would like to show the observation time as 24-hour clock and not - as is send to me - as 12-hour clock.
Fx: I would like to convert 04:45 PM to 16:45
Enyone how has an idea to do that?
What format do you get the date in? xml date? ie. 2010-10-29T04:45:00 or?
You could try calling the ShortTime method (umbraco.library xslt extension) like this:
<xsl:value-of select="umbraco.library:ShortTime(@date)" />
If .NET can convert the content of @date to a DateTime, that should work. You might have to remember selecting a culture that uses 24-hours. This can be done in the Content tree, manage hostnames etc.
Hope this helps, if not, let me know and I'll be a bit more specific.
The feed I get contains the clock as...
But I think you are right! If I type
I get "13:13". (Right now the feed shows 07:42 AM, so I can't use that for test)
Thank you very much. I'll keep an eye on it this afternoon, and if it still works - then my problem is solved!
No problem, remember to mark the thread as solved .. if everything is working this afternoon!
is working on a reply...