back

by sixhobbits·10y ago·view on hn ↗
On the contrary, last time I needed to parse natural dates in Python I got confused because there are dozens of libraries that do exactly this. One example:

    >>> from parsedatetime import Calendar
    >>> cal = Calendar()
    >>> cal.parse("The day after tomorrow")
    (time.struct_time(tm_year=2016, tm_mon=10, tm_mday=3, tm_hour=9, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=277, tm_isdst=-1), 1)
Yes I've used Java equivalents before and they're impressive, but I don't think Python is inferior in this regard. For me, the advantage of Python is mainly being able to easily run small sections of project code in an IPython shell while developing that make the development workflow so much faster and more pleasant, rather than the quantity of code.
1 comments
Thanks for pointing this out. We missed this during our comparison studies.
Looks like the output I pasted is actually wrong though so maybe I spoke too soon.