Why when I Adding a Data Veriable I must correct them by adding some hours to them. When I using ToUniversalTime().AddHours(2.0) i must add a two hours, and if I using ToLocalTime().AddHours(-1.0) I must minus One Hour.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
Maybe you can use something like this:
So to convert a value from the user's timezone, convert it to UTC with zone.LocalTimeToUTC and to convert it back, use UTCToLocalTime. Warning: I guess this will take the regional settings of the user in SHAREPOINT, not from your computer... So if you move to another timearea, you'll still convert to regionalsettings in the previous region... Also, I don't know how this will work with winter or summer-time... |
||||
|
|
|
Timezones vary between eachother. |
|||||||||||||||
|