How can I determine if iPhone is set for 12 hour or 24 hour time display?

Here’s the best way to do it: NSString *formatStringForHours = [NSDateFormatter dateFormatFromTemplate:@”j” options:0 locale:[NSLocale currentLocale]]; NSRange containsA = [formatStringForHours rangeOfString:@”a”]; BOOL hasAMPM = containsA.location != NSNotFound; in Swift: let formatString: NSString = NSDateFormatter.dateFormatFromTemplate(“j”, options: 0, locale: NSLocale.currentLocale())! let hasAMPM = formatString.containsString(“a”) Swift 4: let formatString = DateFormatter.dateFormat(fromTemplate: “j”, options: 0, locale: Locale.current)! let hasAMPM = … Read more

A good date converter for Jalali Calendar in Java? [closed]

For better localization and language support, it is often convenient to use the ICU (International Components for Unicode) library from IBM. The APIs are similar to the standard Java APIs, but add additional support for localization and internationalization (e.g. time and calendar issues, sorting, formatting rules and a regex implementation with proper Unicode support). To … Read more

How do I get localized date pattern string?

For SimpleDateFormat, You call toLocalizedPattern() EDIT: For Java 8 users: The Java 8 Date Time API is similar to Joda-time. To gain a localized pattern we can use class DateTimeFormatter DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM); Note that when you call toString() on LocalDate, you will get date in format ISO-8601 Note that Date Time API in Java 8 is … Read more

.NET (3.5) formats times using dots instead of colons as TimeSeparator for it-IT culture?

I can guarantee in Italy we use colons to separate hour and minute digits, and we use the 24-hour format. Wikipedia is correct (at least this time). Your problem is likely that you’re not setting the Thread’s UI culture. Something like this should work: Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(“it-IT”);

Is it possible to update a localized storyboard’s strings?

There are two options: Option 1 Xcode can “reload” the file by converting the file to either an [Interface Builder Cocoa Touch Storyboard] file type or a [Localizable Strings] file type. Select your base storyboard file from the Project Navigator Find the Localization section in the File Inspector If your file is currently a [Localizable … Read more