1

why NSDatePicker is changing its datevalue on changing the timezone? and how to prevent the change of datevalue of date picker.

I Know if we set the timezone of 'datepicker' it doesn't change,My exact requirement is,what ever the time zone the time of 'datepicker' as well as the time of the date component should not change But at the same time the application should follow the changed 'timezone'

My Exact requirement is at any timezone the operation should perform at particular.but the time of the datepicker should not change at the same time the application should follow the current timezone.

Thanks in advance

1 Answers1

0

you will have to observe NSSystemClockDidChangeNotification, see:

How can I get notified of a system time change in my Cocoa application?

then you will have to calculate the new date and set it in the NSDatePicker.

or alternately you can set the time zone of the picker, so that it doesn't use the auto updating current locale.

it depends on what you hope to achieve, as the first one will change the date value, the second will just freeze the view layer in a particular time zone.

Community
  • 1
  • 1
Grady Player
  • 14,399
  • 2
  • 48
  • 76
  • When the timezone changes i am not getting any clock change notification, i am able to get NSSystemTimezoneDidChange notification,But the problem is it is sending the notification twice in some cases (with old timezone & with new timezone) and only once in some cases.so i am unable to calculate the offset exactly between two nstimezones. – Dhanunjay Kumar Jun 18 '13 at 14:16