Update README.md

This commit is contained in:
Ralph Küpper 2018-03-09 08:43:10 -05:00 committed by GitHub
parent c8d819bad6
commit ae75e10a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,11 @@ With _SwiftyDates_ all you need to do is this:
let dateString = "2018-03-08T15:49:46Z" let dateString = "2018-03-08T15:49:46Z"
let date:Date = dateString.swiftyDateTime() // this will work let date:Date = dateString.swiftyDateTime() // this will work
``` ```
Likewise the other date will work too:
```swift
let dateString = "2018-03-08T15:49:46.5+03:30"
let date:Date = dateString.swiftyDateTime() // this will work
```
## Dates ## Dates
@ -36,6 +41,14 @@ let dateString = "2018-03-08"
let date:Date = dateString.swiftyDate() // this will work let date:Date = dateString.swiftyDate() // this will work
``` ```
## Times
For dates you can use:
```swift
let dateString = "9:30am"
let date:TimeInterval = dateString.swiftyTime() // this will work
```
## Examples ## Examples
The beauty of this library is that it will also understand other formats, for example: The beauty of this library is that it will also understand other formats, for example: