ASP.NET with SQL changing UTC - Time off by 5 Hours?? RRS feed

  • Question

  • User1811480695 posted

    Ok .... I've been trying to resolve this ... I have a page that displays Users and activity etc.. it pulls this data from the aspnet_Users table using  stored procedure below:

    SELECT aspnet_Users.UserName, aspnet_Roles.RoleName, aspnet_Membership.CreateDate, aspnet_Users.LastActivityDate

    FROM aspnet_Users INNER JOIN

    aspnet_UsersInRoles ON aspnet_Users.UserId = aspnet_UsersInRoles.UserId INNER JOIN

    aspnet_Roles ON aspnet_UsersInRoles.RoleId = aspnet_Roles.RoleId INNER JOIN

    aspnet_Membership ON aspnet_Users.UserId = aspnet_Membership.UserId

    It displays everything I ask .. but the Time is off by 5 Hours. .... Now I know this is because of UTC .... but I don't know where to change this ... it defaults to UTC ... can I define it to server time?




    Saturday, March 14, 2009 12:43 PM

All replies

  • User-158764254 posted

    if you are using 3.5, then you can use TimeZoneInfo.ConvertTimeFromUtc to chande the UTC datetime to another suitable timezone

    Saturday, March 14, 2009 3:25 PM