Latest 3.0.3
Homepage https://github.com/readefries/RFISO8601DateTime
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

Usage

Using is very easy, to parse an RFC3339 date/time string, just do the following.

let rfc3339DateTime = "1985-04-12T23:20:50.52Z"
let parsedDateTime = NSDate.parseDateString(rfc3339DateTime)

Supported date/time formats

RFISO8601DateTime currently supports the following date/time formats:

  • calendar month (e.g., 2008-08).
  • Calendar date, such as 2008-08-30 or 20080830.
  • Ordinal date (e.g., 2008-243).
  • Week of the year (e.g., 2008-W35).
  • Week date (e.g., 2008-W35-6).
  • Hours and minutes (e.g., 17:21).
  • Hours, minutes, and seconds (e.g., 17:21:59).
  • Time zone designator (e.g., Z, +07 or +07:00).
  • Hours, minutes, and seconds with time zone designator (e.g., 17:21:59+07:00).
  • Calendar date with hours, minutes, and seconds (e.g., 2008-08-30 17:21:59 or 20080830 172159).
  • Date, with optional time zone (e.g., 2008-08-30 or 2008-08-30+07:00).
  • Time, with optional fractional seconds and time zone (e.g., 01:45:36 or 01:45:36.123+07:00).
  • Date and time, with optional fractional seconds and time zone (e.g., 2008-08-30T01:45:36 or 2008-08-30T01:45:36.123Z).
  • Date and time in RFC2822 format (e.g. Fri, 21 Nov 1997 09:55:06 -0600).

Requirements

Installation

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

pod 'RFISO8601DateTime', '~> 3.0' # Swift 4.0
pod 'RFISO8601DateTime', '~> 2.0' # Swift 3.0
pod 'RFISO8601DateTime', '~> 1.0' # Swift 2.3

Author

Hindrik Bruinsma, [email protected]

License

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

Latest podspec

{
    "name": "RFISO8601DateTime",
    "version": "3.0.3",
    "summary": "A library to easily use ISO8601 date and time.",
    "description": "A small library that can automatically parse ISO8601/RFC3339/RFC2822 datenand time. It extends NSDate and recognise different date and time formats using regular expression.",
    "homepage": "https://github.com/readefries/RFISO8601DateTime",
    "license": "MIT",
    "authors": {
        "Hindrik Bruinsma": "[email protected]"
    },
    "source": {
        "git": "https://github.com/readefries/RFISO8601DateTime.git",
        "tag": "3.0.3"
    },
    "social_media_url": "https://twitter.com/readefries",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "RFISO8601DateTime/**/*.swift"
}

Pin It on Pinterest

Share This