parsing - Parse French date in python -


Can someone please tell me how can I parse French date in Python? Sorry, if the question is duplicate, but I could not find any.

Here I have tried to use the dateutil parser: dateutil.parser import parse_dt from locale.setlocale (Locale Import location) # lc_time, 'fr_FR.UTF-8') ## I had previously set local level ## locale. LC_TIME, 'fr_FR.UTF-8') parse_dt ('3 juillet', fuzzy = True) ## Do not work Default month ## Out [2 9]: datetime.datetime (2014, 10, 3, 0, 0) Parse_dt (u'4 AoA T ', Fuzzy = True) # # Edit the same thing by using the same month

Edit: Add some references:

I The idea of ​​parsing several dates in the fly is parsing the format of your string in advance without preferring the address:

  parse_dt (u'Aujourd''hui ', fuzzy = tru) pars_date (u 'Hair, fuzzy = true)   

other library Edit using:

To translate Persian words, I can get it by using the Perseidum Library and some regular expressions:

  Import = Personate Time Calendar () Cal.Parse (Reefer Wiab ('Jual. *', 'Jul', '20 Joulet ')) ((2015, 7, 20, 10, 25, 47, 4, 283, 1), 1)   

Maybe I should make it normal in all French months?

can parse dates in question:

  #! / Usr / bin / env python # - * - coding: UTF-8 - * - Import DatePaster # $ pip for installation dateparser date_string in [u "ojdhui", "3 juliet", u "4 ao tt", u "Higher"]: Print (Datachers. PRSE (date_string) .date ())   

It translates the dates of English using dates and passes the date string.

Output
  2015-09-09 2015-07-03 2015-08-04 2015 -09-08    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -