hi
i would like to know (when my app starts) if the device clock is set to AM/PM or 24h
i found this:
http://stackoverflow.com/questions/7448360/detect-if-time-format-is-in-12hr-or-24hr-format
would this work in b4i?
i would like to know (when my app starts) if the device clock is set to AM/PM or 24h
i found this:
B4X:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setLocale:[NSLocale currentLocale]];
[formatter setDateStyle:NSDateFormatterNoStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
NSString *dateString = [formatter stringFromDate:[NSDate date]];
NSRange amRange = [dateString rangeOfString:[formatter AMSymbol]];
NSRange pmRange = [dateString rangeOfString:[formatter PMSymbol]];
BOOL is24h = (amRange.location == NSNotFound && pmRange.location == NSNotFound);
[formatter release];
NSLog(@"%@\n",(is24h ? @"YES" : @"NO"));
http://stackoverflow.com/questions/7448360/detect-if-time-format-is-in-12hr-or-24hr-format
would this work in b4i?