Latest 1.3.0
License MIT
Platforms ios 9.0


Build Status

Github Current ReleaseCocoapods PlatformsXcode 10.0+iOS 9.0+Swift 5.0+Github Repo SizeGithub Code SizeGithub Closed PR's


codebeat badge


This framework supports encoding as well as decoding many different date and time format. At the moment the follownig are supported (see SHDateFormat):

  • shortWeekdayName => Sun, Mon, Tue, …
  • longWeekdayName => Sunday, Monday, Tuesday, …
  • shortTimeNoDate => 12:00 PM, 1:00 AM
  • noTimeShortDateNoYear => 12/31
  • noTimeShortDate => 12/02/2018
  • noTimeLongDate => December 2, 2018
  • noTimeRelativeDate => Today, Tomorrow, …
  • ISO8601 => "yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ss’Z’"

The ISO8601 format implements the standard for working with dates and times between client and server applications. A good explanation if this standard and how to work with it can be found in the Apple Documenation or on Ole Begemanns Blog.

Additionally the following convenience functions are available on the SHDateFormatter sharedInstance which will return default values if the input date is nil. They allow to easily deal with optionals and can provide additional functionality like giving you a relative date instead of e.g. "yyyy/MM/dd":

  • localizedTimeStringFromDate(_:) – will return --:-- per default
  • … to be continued …


The framework is compatible with Xcode 9 and Swift 4. The minimum version is iOS 8.


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

pod 'SHDateFormatter'

Next Steps

  • include more convenience functions to better support relative dates
  • tests for string2date conversion
  • support swift package manager and carthage


  • If you found a bug, please open an issue.
  • If you have a feature request, please open an issue.
  • If you want to contribute, please submit a pull request.


Stefan Herold@Blackjacxxx


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

Latest podspec

    "name": "SHDateFormatter",
    "version": "1.3.0",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "summary": "A date formatter supporting encoding as well as decoding of many different date and time formats including the often used ISO8601 standard.",
    "description": "'Date formatting is no easy task because there are a lot of things that can be done wrong. This framework will take this burden from you. With very well tested state of the art code that is used in some highly active and often downloaded apps you don't need to think about date formatting again - never. Promised ud83cudf7b'",
    "homepage": "",
    "social_media_url": "",
    "authors": {
        "Stefan Herold": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.3.0"
    "platforms": {
        "ios": "9.0"
    "source_files": "source/Classes/**/*"

Pin It on Pinterest

Share This