Popularity
1.1
Growing
Activity
0.0
Stable
21
4
6

Programming language: Swift
License: MIT License
Tags: Text    
Latest version: v1.1.0

ISO8601 alternatives and similar libraries

Based on the "Text" category.
Alternatively, view ISO8601 alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of ISO8601 or a related project?

Add another 'Text' Library

README

ISO8601

❤️ Support my apps ❤️

❤️❤️😇😍🤘❤️❤️

ISO8601 in Swift

Version Carthage Compatible License Platform

[](Screenshots/Banner.png)

Description

My answer on How do I get ISO 8601 date in iOS?

Usage

Formatter

Create a new formatter

var config = Config()
config.timeZoneIdentifier = " +0000"
let formatter = Formatter(config: config)

or use the default

Formatter.shared

Convert string to date

Formatter.shared.date(string: "2016-04-08T10:25:30Z")       // extended format with Z
Formatter.shared.date(string: "20160408 10:25:30Z")         // basic format with Z
Formatter.shared.date(string: "2016-04-08 112530 +010000")  // extended format with timezone offset
Formatter.shared.date(string: "2016-04-08 202530GMT+1000")  // extended format with GMT
Formatter.shared.date(string: "2016-04-08T10:25:30.000Z")   // milliseconds

Convert date to string

let date = Date(timeIntervalSince1970: 1460111130)
Formatter.shared.string(date: date) // 2016-04-08T10:25:30Z // timezone Z

Installation

ISO8601 is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ISO8601', git: 'https://github.com/onmyway133/ISO8601'

ISO8601 is also available through Carthage. To install just write into your Cartfile:

github "onmyway133/ISO8601"

Author

Khoa Pham, [email protected]

Contributing

We would love you to contribute to ISO8601, check the CONTRIBUTING file for more info.

License

ISO8601 is available under the MIT license. See the LICENSE file for more info.


*Note that all licence references and agreements mentioned in the ISO8601 README section above are relevant to that project's source code only.