UIDatePicker Date property is always low by one day or one hour

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

UIDatePicker Date property is always low by one day or one hour

guivho
The DatePicker has a Date property, but its value is always low by 1 day.

When you select e.g. 2012-01-01 it has value 2011-12-31.

The value displayed on the picker is correct, but the Date Property is wrong.

This can easily be demonstrated with this little project.

Whenever the DatePicker is changed, the current Date value is written
to the console.

The little demo at https://github.com/guivho/DatePickerTest only
demonstrates the problem for UIDatePickerMode.Date cases.

But the two other modes can also be tested by fiddling with the
comments on the mode lines.

UIDatePickerMode.DateAndTime and UIDatePickerMode.Time pickers have
the hour field low by one hour.

I detected this problem with the latest 5.2.x MT, but it may well be
inherited from previous versions.

I submitted a bug at http://bugzilla.xamarin.com/show_bug.cgi?id=3389


Guido
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: UIDatePicker Date property is always low by one day or one hour

Jackson Harper
I think It's in UTC time.


Sent from my iPhone

On Feb 10, 2012, at 3:42 PM, Guido Van Hoecke <[hidden email]> wrote:

> The DatePicker has a Date property, but its value is always low by 1 day.
>
> When you select e.g. 2012-01-01 it has value 2011-12-31.
>
> The value displayed on the picker is correct, but the Date Property is wrong.
>
> This can easily be demonstrated with this little project.
>
> Whenever the DatePicker is changed, the current Date value is written
> to the console.
>
> The little demo at https://github.com/guivho/DatePickerTest only
> demonstrates the problem for UIDatePickerMode.Date cases.
>
> But the two other modes can also be tested by fiddling with the
> comments on the mode lines.
>
> UIDatePickerMode.DateAndTime and UIDatePickerMode.Time pickers have
> the hour field low by one hour.
>
> I detected this problem with the latest 5.2.x MT, but it may well be
> inherited from previous versions.
>
> I submitted a bug at http://bugzilla.xamarin.com/show_bug.cgi?id=3389
>
>
> Guido
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: UIDatePicker Date property is always low by one day or one hour

guivho
Hi,

On Fri, Feb 10, 2012 at 22:04, Jackson Harper <[hidden email]> wrote:
> I think It's in UTC time.

I feel very, very embarassed :(

Thanks, nevertheless


Guido
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: UIDatePicker Date property is always low by one day or one hour

guivho
On Fri, Feb 10, 2012 at 22:09, Guido Van Hoecke <[hidden email]> wrote:
> Hi,
>
> On Fri, Feb 10, 2012 at 22:04, Jackson Harper <[hidden email]> wrote:
>> I think It's in UTC time.
>
> I feel very, very embarassed :(

My local time is UTC+1, so the reported date is midnight - 1 hour, ergo the
previous day.

Confusing, but I should have realized...

Guido
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch