DateTimePicker timezones

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

I was wondering if you guys had a datetime picker that doesn’t do any timezone conversion to UTC?

We have a UI where a customer can select a date and time and then timezone for that datetime and we’ve been fighting Wisej’s datetimepicker because it is converting it to UTC.

Thanks,
Mark

  • You must to post comments
0
0

I think I got it working I added a new function to the customdatetimepicker like this.

public void SetValue(DateTime startTime, TimeZoneInfo originalTimeZone)
{
var diff = (originalTimeZone.BaseUtcOffset.TotalMinutes – Application.Browser.TimezoneOffset) – originalTimeZone.BaseUtcOffset.TotalMinutes;
startTime = startTime.AddMinutes(diff * -1);
startTime = DateTime.SpecifyKind(startTime, DateTimeKind.Utc);
this.Value = startTime;
}

  • Mark Reed
    The regardless of the browser’s timezone it always show the same time in the datetimepicker textbox
  • You must to post comments
0
0

You need to set the timezone on the DateTimePicker?

Dates are always managed using UTC since the server and the client may very well be in different time zones. When the date arrives at the server, it is converted to local time using the timezone of the client for that specific session/thread. For example, a user in NY using a server in California would always have the dates using the NY timezone.

  • Mark Reed
    I totally get that which is why I am having issues. Because the server is in UTC. The browser might be in Kiev and he might be setting the time to 8:00pm PST
  • Luca (ITG)
    What type of issues? UTC is the same as GMT or +0, the client in Kiev should always see and have the date values in Kiev time. Otherwise it’s a bug in Wisej.
  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json