datefmt 0.3.0

Datetime parsing and formatting


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

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:
1.0.4 2019-Nov-28
1.0.3 2019-May-14
1.0.2 2017-Dec-20
1.0.1 2017-Dec-14
1.0.0 2017-Dec-12
Show all 10 versions
Download Stats:
  • 1 downloads today

  • 8 downloads this week

  • 8 downloads this month

  • 1030 downloads total

Score:
0.9
Short URL:
datefmt.dub.pm