uiDateTimePicker Fix NSDatePicker timezone handling

This commit is contained in:
cody271 2018-02-22 18:36:37 -08:00
parent 57b225a629
commit cf671c1da5
1 changed files with 1 additions and 4 deletions

View File

@ -126,14 +126,11 @@ void uiDateTimePickerTime(uiDateTimePicker *d, struct tm *time)
time_t t;
struct tm tmbuf;
NSDate *date;
NSTimeInterval interval;
date = [d->dp dateValue];
interval = [[NSTimeZone systemTimeZone] secondsFromGMTForDate:date];
date = [date dateByAddingTimeInterval:interval];
t = (time_t) [date timeIntervalSince1970];
tmbuf = *gmtime(&t);
tmbuf = *localtime(&t);
memcpy(time, &tmbuf, sizeof(struct tm));
}