Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comprehensive list of date format patterns in obj-c for iOS

Is there an actual, comprehensive list of supported date format patterns/tokens? I've been looking at the API docs, and they mention a few of them, such as MM, but where's the rest?

like image 635
chinabuffet Avatar asked Dec 13 '12 14:12

chinabuffet


People also ask

What is Dateformatter?

A formatter that converts between dates and their textual representations.

How do I change the date format in Swiftui?

Your dateFormat in ListViewRow is E, dd MMM yyyy , whereas your date is in format E, dd MMM yyyy HH:mm:ss z . You must convert your date using this dateFormat. You can then use the date object to get a string in your desired format.

How do I get todays date in Swift?

Get current time in “YYYY-MM–DD HH:MM:SS +TIMEZONE” format in Swift. This is the easiest way to show the current date-time.


2 Answers

Apple imports the Unicode standard so the appendix that summarises date format fields is here.

like image 123
Tommy Avatar answered Sep 21 '22 17:09

Tommy


If you follow the links to the "Data Formatting Guide", you will see this information:

The format string uses the format patterns from the Unicode Technical Standard #35. The version of the standard varies with release of the operating system:

  • Formatters in iOS 5.0-5.1 use version tr35-19.
  • Formatters in iOS 4.0-4.2 use version tr35-15.
  • Formatters in iOS 3.2 use version tr35-12.
  • Formatters in OS X v10.8 and iOS 6.0 use version tr35-25.
  • Formatters in OS X v10.7 and iOS 4.3 use version tr35-17.
  • Formatters in OS X v10.6 and iOS 3.0-3.1 use version tr35-10.
like image 45
Mike Weller Avatar answered Sep 21 '22 17:09

Mike Weller