As it seems there's no way to manage a different Timezone than the server's I'm requested to add 6hours when displaying node's creation time... i've had a loook at the forum but found nothing so far.
Is there an easy way to add some time to a retrieved date/hour?
Paul, I'm using just XSLT at the moment but your solution seems a pretty elegant and good one... When I have the time to really do things properly I'm sure I'll revisit this thread to get your code ;).
I have also used a similar function in other projects and called them from within XSLT - it works very well. I might go make a suggestion in the Umbraco 5 forum :)
Add hours to retrieved time
Hello all,
As it seems there's no way to manage a different Timezone than the server's I'm requested to add 6hours when displaying node's creation time... i've had a loook at the forum but found nothing so far.
Is there an easy way to add some time to a retrieved date/hour?
Thanks a lot!
Hi Jacobo,
You can use DateAdd, all the information is here http://our.umbraco.org/wiki/reference/umbracolibrary/dateadd
Post back if you need further info.
Rich
Here you go...
The problem with just adding a set amount of time is that it won't always be correct if you need to adjust for Daylight Savings Time.
I've added a routine to some of my projects that uses the .NET TimeZoneInfo class:
Convert the server time to UTC and then convert the UTC to local time.
Thanks a lot Rich Green, that worked perfectly!
Paul, I'm using just XSLT at the moment but your solution seems a pretty elegant and good one... When I have the time to really do things properly I'm sure I'll revisit this thread to get your code ;).
Thanks a lot to both!
I have also used a similar function in other projects and called them from within XSLT - it works very well. I might go make a suggestion in the Umbraco 5 forum :)
is working on a reply...