Skip to content
DateFormatter conforming to RFC3339
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Demo.playground
RFC3339DateFormatter.xcodeproj
RFC3339DateFormatter.xcworkspace
Sources/RFC3339DateFormatter
Tests
.gitignore
.swift-version
.travis.yml
Package.swift
README.md
RFC3339DateFormatter.podspec

README.md

RFC3339DateFormatter

Swift version CocoaPods compatible Carthage compatible Build Status

DateFormatter conforming to RFC3339

Usage

Demo.playground

Date from String

import RFC3339DateFormatter

// with T, nanosecond
RFC3339DateFormatter.date(from: "2017-01-01T00:00:00.000Z")
RFC3339DateFormatter.date(from: "2017-01-01T09:00:00.000+09:00")
// with T
RFC3339DateFormatter.date(from: "2017-01-01T00:00:00Z")
RFC3339DateFormatter.date(from: "2017-01-01T09:00:00+09:00")
// with ` `, nanosecond
RFC3339DateFormatter.date(from: "2017-01-01 00:00:00.000Z")
RFC3339DateFormatter.date(from: "2017-01-01 09:00:00.000+09:00")
// with ` `
RFC3339DateFormatter.date(from: "2017-01-01 00:00:00Z")
RFC3339DateFormatter.date(from: "2017-01-01 09:00:00+09:00")
// different number of digits of nanosecond
RFC3339DateFormatter.date(from: "2017-01-01 00:00:00.0Z")

Date to String

import RFC3339DateFormatter

RFC3339DateFormatter.string(from: Date()) // "2017-12-01T06:25:11.029Z"

Installation

Carthage

Cartfile

github "morishin/RFC3339DateFormatter"

CocoaPods

Podfile

pod 'RFC3339DateFormatter'

LICENSE

MIT

You can’t perform that action at this time.