🎗 Super lightweight ISO8601 Date Formatter in Swift

Overview

ISO8601

❤️ Support my apps ❤️

❤️ ❤️ 😇 😍 🤘 ❤️ ❤️

ISO8601 in Swift

Version Carthage Compatible License Platform

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.

You might also like...
A simple and customizable Markdown Parser for Swift
A simple and customizable Markdown Parser for Swift

MarkdownKit MarkdownKit is a customizable and extensible Markdown parser for iOS and macOS. It supports many of the standard Markdown elements through

Marky Mark is a parser written in Swift that converts markdown into native views.
Marky Mark is a parser written in Swift that converts markdown into native views.

Marky Mark is a parser written in Swift that converts markdown into native views. The way it looks it highly customizable and the supported markdown syntax is easy to extend.

Swift Parser Combinators

Parsey Swift Parser Combinator Framework In addition to simple combinators, Parsey supports source location/range tracking, backtracking prevention, a

Great Swift String Pluralize Extension

Pluralize.swift Great Swift String Pluralize Extension case-insensitive tons of rules for irregular nouns (plural form) supports uncountable nouns all

An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.
An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.

PrediKit A Swift NSPredicate DSL for iOS & OS X inspired by SnapKit, lovingly written in Swift, and created by that weird dude at KrakenDev. If you're

PySwiftyRegex - Easily deal with Regex in Swift in a Pythonic way

PySwiftyRegex Easily deal with Regex in Swift in a Pythonic way.

Regular expressions for swift
Regular expressions for swift

Regex Advanced regular expressions for Swift Goals Regex library was mainly introduced to fulfill the needs of Swift Express - web application server

👩‍🎨 Elegant Attributed String composition in Swift sauce
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

SwiftVerbalExpressions is a Swift library that helps to construct difficult regular expressions

SwiftVerbalExpressions Swift Regular Expressions made easy SwiftVerbalExpressions is a Swift library that helps to construct difficult regular express

Releases(1.1.0)
Owner
Khoa
Check my apps https://onmyway133.com/apps
Khoa
UITextField realtime currency formatter - format while typing

Objective-C Realtime Currency Formatter An extremely simple Objective-C class for formatting currencies. Ready to work with the UITextFieldDelegate an

Kaio Medau 14 Jul 28, 2022
A comprehensive, lightweight string extension for Swift

SwiftString SwiftString is a lightweight string extension for Swift. This library was motivated by having to search StackOverflow for common string op

Andrew Mayne 1.6k Dec 30, 2022
Lightweight library to set an Image as text background. Written in swift.

![](https://img.shields.io/badge/Swift 2-compatible-4BC51D.svg?style=flat-square) Simple and light weight UIView that animate text with an image. Demo

Lucas Ortis 552 Sep 9, 2022
CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS

CodeMirror-Swift is a lightweight wrapper of CodeMirror for macOS and iOS. Features ?? Lightweight CodeMirror wrapper (build 5.52.2) ✅ 100% Native Swi

Proxyman 86 Dec 30, 2022
VEditorKit - Lightweight and Powerful Editor Kit built on Texture(AsyncDisplayKit)

VEditorKit provides the most core functionality needed for the editor. Unfortunately, When combined words are entered then UITextView selectedRange will changed and typingAttribute will cleared. So, In combined words case, Users can't continue typing the style they want.

David Ha 471 Dec 27, 2022
SZMentionsSwift is a lightweight mentions library for iOS.

SZMentionsSwift is a lightweight mentions library for iOS. This library was built to assist with the adding, removing and editing of a mention within a textview.

Steven Zweier 122 Dec 12, 2022
A lightweight fuzzy-search library, with zero dependencies

Fuse What is Fuse? Fuse is a super lightweight library which provides a simple way to do fuzzy searching. Usage Example 1 let fuse = Fuse() let result

Kiro Risk 864 Dec 29, 2022
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022
Croc is a swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji characters, making emoji-powered features an easy task for developers.

Joe Kalash 127 Nov 20, 2022
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Tatsuya Tobioka 1.2k Jan 1, 2023