Recently I used the NSDate class in a project, and found that it is producing
the correct date but the incorrect time, for example.
Display incorrect time.
The output to the log showed the correct date part of the string, but
displayed the time part as one hour behind the current system time, the
minutes and seconds where correct, but not the hours.
My settings in the System preferences are all correct, and when writing an
Applescript to check the date, this also produced the correct time.
Appescript
Displays the correct time.
even the date shell command displays the correct date & time, but the NSDate method
above always shows the hours part of the date as one hour behind.
Any Ideas what causes this.
Regards Mark
the correct date but the incorrect time, for example.
Code:
NSDate *now = [NSDate date];
NSLog(@"%@", now);
Display incorrect time.
The output to the log showed the correct date part of the string, but
displayed the time part as one hour behind the current system time, the
minutes and seconds where correct, but not the hours.
My settings in the System preferences are all correct, and when writing an
Applescript to check the date, this also produced the correct time.
Appescript
Code:
set theDate to the (current date)
Displays the correct time.
even the date shell command displays the correct date & time, but the NSDate method
above always shows the hours part of the date as one hour behind.
Any Ideas what causes this.
Regards Mark