datefmt 1.0.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": "~>1.0.0"
.
- Registered by Christopher Wright
- 1.0.0 released 7 years ago
- dhasenan/datefmt
- Ms-PL
- Copyright © 2017, dhasenan
- Authors:
- 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 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
4 downloads this month
-
1121 downloads total
-
- Score:
- 1.0
- Short URL:
- datefmt.dub.pm