Colin via Digitalmars-d-learn
2014-10-23 11:13:25 UTC
Hi,
I'm looking for an easy way to parse a dates into a datetime
object.
Most of my dates will be of the form:
mmm dd, yyyy HH:MM AM|PM
So like: "May 30, 2014 12:12 PM"
I can easily write a regex or whatever to pull these out of that
one format, but it's not guaranteed they'll all be in the one
format and I may have to deal with others.
Is there a helper function that I'm missing that can parse these
dates? Maybe something similar to pythons dateutil.parser [1] ?
If not maybe adding this function to std.datetime would be a good
project to undertake for myself...
[1] - https://labix.org/python-dateutil
I'm looking for an easy way to parse a dates into a datetime
object.
Most of my dates will be of the form:
mmm dd, yyyy HH:MM AM|PM
So like: "May 30, 2014 12:12 PM"
I can easily write a regex or whatever to pull these out of that
one format, but it's not guaranteed they'll all be in the one
format and I may have to deal with others.
Is there a helper function that I'm missing that can parse these
dates? Maybe something similar to pythons dateutil.parser [1] ?
If not maybe adding this function to std.datetime would be a good
project to undertake for myself...
[1] - https://labix.org/python-dateutil