Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shannon 148 posts 171 karma points
    Apr 15, 2011 @ 18:52
    Shannon
    0

    Time zone adjustment in Umbraco

    Is there a way to adjust the timezone Umbraco uses. I have a webserver set to GMT/UTC time and writers that post in EST. Is there a way to adjust the time? Thanks.

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Apr 16, 2011 @ 14:45
    Sebastiaan Janssen
    0

    Unfortunately, something like this is very difficult to deal with, the best thing I could find is this: http://www.velocityreviews.com/forums/t119394-set-timezone-for-an-asp-net-web-app.html - Which basically say: you will have to convert the time to a different timezone on the frontend if you need to. It's that or change the time on the server.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Apr 18, 2011 @ 10:32
    Darren Ferguson
    0

    You can do something like:

    var est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
    var estNow = TimeZoneInfo.ConvertTime(DateTime.Now, est);

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Apr 18, 2011 @ 14:40
    Sebastiaan Janssen
    0

    @Darren I seem to recall that this isn't very reliable with daylight savings time. But I can't say I have first hand experience, so it might work.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Apr 18, 2011 @ 14:58
    Darren Ferguson
    0

    @Sesbastiaan - maybe something like this then:

     

     var est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
                var utcOffset = new DateTimeOffset(DateTime.UtcNow, TimeSpan.Zero);
                var estNow = utcOffset.ToOffset(est.GetUtcOffset(utcOffset));

    Should give you the offset.

     

  • Shannon 148 posts 171 karma points
    Apr 20, 2011 @ 06:38
    Shannon
    0

    Where would I plug that in Darren?

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Apr 20, 2011 @ 09:58
    Darren Ferguson
    0

    Shannon - you'd need to expand on "the time Umbraco uses". What specifically do you want Umbraco to do with your EST times. My gut feeling is that you would store the local time and calculate the offset when you want to display.

  • Shannon 148 posts 171 karma points
    Apr 21, 2011 @ 17:41
    Shannon
    0

    I am using Blog4Umbraco and hosting Umbraco in Microsoft Azure. Azure has their servers set to GMT. My writes are mostly on the West coast (PST) and I would like to have the times that show in PST as not to confuse the writers and having them manage 2 different times zone and remember when to post articles.

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Apr 22, 2011 @ 12:59
    Darren Ferguson
    0

    The times on the front end website or in the backoffice.

    For the latter I don't believe Umbraco stores any information about the timezone of it's users - I guess that would be a modification to the core.

     

  • Debendra Kumar 4 posts 24 karma points
    May 12, 2015 @ 14:12
    Debendra Kumar
    0

    hi

    I need time zone package for Umbraco, (Ex. Suppose i have one hosted website , if ill browse this site in any one country time should be display for that perticular country.)

    If any package or  code for this please post.

     

    Regards,

    Debendra

Please Sign in or register to post replies

Write your reply to:

Draft