Latest 0.1.0
Homepage https://github.com/pdn1905/SDDateHelper
License MIT
Platforms ios 8.0
Dependencies NTPKit
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'SDDateHelper', :git => https://github.com/pdn1905/SDDateHelper

How to use:

Import SDDateHelper

Math with Date:

let today = Date() // 21-09-2017 📅
let nextDay = today + 1.day => 22-09-2017 // same with minutes, hours, months, years..

Compare between Dates:

let today = Date() // 21-09-2017
let nextDay = today + 1.day => 22-09-2017 
let bool = today < nextDay => return true

Get Network time (if failed return device time):

SDTime().getNetworkTime { (date) in
    print(date) => return sync network time.
}

Custom services:

SDTime().getNetworkTime(with: ["time1.google.com","time2.google.com"]) { (date) in
  print(date) => return sync network time.
}
  let now = SDTime().now => sync network time.

From Ngoc With Love 😜.

Author

NgocPhan😻, [email protected]

License

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

Latest podspec

{
    "name": "SDDateHelper",
    "version": "0.1.0",
    "summary": "The best way to handler date, time and get True time with SDDateHelper",
    "description": "The best way to handler date, time and get True time with SMDDateHelper",
    "homepage": "https://github.com/pdn1905/SDDateHelper",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pdn1905": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pdn1905/SDDateHelper.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SDDateHelper/*",
    "dependencies": {
        "NTPKit": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This