datefmt 0.4.0

Datetime parsing and formatting


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

datefmt

Date formatting and parsing based on strftime.

Usage

Example:

import datefmt;
auto st = SysTime(DateTime(2014, 4, 17, 14, 47, 35), UTC());
writefln(st.format("%a, %d %b %Y %H:%M:%S GMT"));
// Thu, 17 Apr 2014 14:47:35 GMT

Most of the formatting options can also be used to parse:

import datefmt;
auto st = "Thu, 17 Apr 2014 14:47:35 GMT".parse("%a, %d %b %Y %H:%M:%S GMT");
assert(st == SysTime(DateTime(2014, 4, 17, 14, 47, 35), UTC()));

Yes, there's another date parsing library out there, but that is to take garbage dates and try to produce something sensible out of it. This is for stricter parsing.

Dub

Add a dependency on "datefmt": "~>0.1.0".

Authors:
dhasenan
Dependencies:
none
Versions:
0.4.0 2017-Sep-01
0.3.0 2017-Jul-04
0.1.1 2017-May-14
0.1.0 2017-May-14
~master 2017-Jul-04
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 2 downloads this month

  • 19 downloads total