Questions tagged [python-dateutil]

The dateutil module provides powerful extensions to the standard datetime module, available as an extension module which is compatible with Python 2.3+.

The dateutil module provides powerful extensions to the standard datetime module, available as a Python extension module which works with Python 2.3+.

432 questions
0
votes
3 answers

Dates Conversion in python

I have three unique date formats, listed below date1 = "2018-05-31 14:34:42+00:00" date2 = "2018-05-21T14:49:52.833" date3 = "2018-06-01 00:00:00" How can I convert into single date format("%Y-%m-%d %H:%M:%S") of all these three dates using…
0
votes
1 answer

rrule weekly for three weeks, then one week not, repeat

I'm using rrule from python dateutil and don't know how to create an rruleset for the following example: Monday, three weeks in a row. Then a week not, then again three weeks in a row, one not, and so on. Any advice on creating an rrule(set) for…
Muling
  • 13
  • 3
0
votes
1 answer

Can't install ElastAlert on elasticsearch6.1.1 by "python-dateutil 2.7.0"

My enviroment: os:ubuntu 16.04 python:2.7.12 elasticsearch:6.1.1 I want to install elasalert0.1.29 by "python setup.py install",but I got this wrong: error: python-dateutil 2.7.0 is installed but python-dateutil<2.7.0,>=2.1 is required by…
0
votes
1 answer

Identifying dates in a string in python using dateutil returning no output

I am trying to identify dates from a column containing text entries and output the dates to a text file. However, my code is not returning any output. I can't seem to figure out what I did wrong in my code. I'd appreciate some help on this. My…
user8929822
  • 273
  • 1
  • 3
  • 13
0
votes
1 answer

dateutils default to the last occurence of recognized part, not next

I am using dateutils.parser.parse to parse date strings which might contain partial information. If some information is not present, parse can take a default keyword argument from which it will fill any missing fields. This default defaults to…
Graipher
  • 6,891
  • 27
  • 47
0
votes
1 answer

Calculating average for relativedelta in python

I have multiple relativedelta values in Python 3 and I would like to take an average of all these. For example, for the 2 values below, I would like a relativedelta value where hours = +3 day (average between the two). relativedelta(days=+2,…
Peter
  • 427
  • 2
  • 7
  • 22
0
votes
0 answers

How can I get confidence metrics from dateutil parser?

I'm using datefinder, which extracts possible date / time strings from a piece of text, then puts those strings through dateutil.parser.parse() to yield datetimes. In a key use case, I have multiple resulting datetimes which probably correspond to…
thclark
  • 4,784
  • 3
  • 39
  • 65
0
votes
2 answers

converting datetime string to the correct timezone

I've went through a few useful discussions on the topic, but still don't understand the following: Say, I have a string "20080730 06:23:54 PDT" which I want to convert to a timezone aware datetime object. I understand, that dateutil.parser.parse()…
LazyCat
  • 496
  • 4
  • 14
0
votes
1 answer

Invalid syntax inside dateutil when importing tensorflow. Why?

Here is the transcript: dims@calculon:~$ pip install tensorflow-gpu Collecting tensorflow-gpu Downloading tensorflow_gpu-1.4.0-cp35-cp35m-manylinux1_x86_64.whl (170.1MB) 100% |████████████████████████████████| 170.1MB 10kB/s Requirement…
Dims
  • 47,675
  • 117
  • 331
  • 600
0
votes
1 answer

Is there a Ruby equivalent of Python's dateutil parser that can parse datetimes from multiple formats?

The dateutil library from Python is super useful for parsing strings of various common formats into datetime objects. Is there something similar for Ruby?
Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
0
votes
1 answer

Parse various human readable time formats to a time object (datetime.time) in Python?

I have a list of strings that may be time objects. Note: NOT datetime objects or timestamp objects. These are times without a reference to epoch or date. For example: time_strings = ['6:00PM', '7:00pm', '8:00am', '17:00:00', '4PM'] Is there a good…
Kate Stohr
  • 99
  • 2
  • 5
0
votes
3 answers

Error while parsing date when input has non-date numeric values

I am parsing date from a pdf document that has other date-like formats Traceback (most recent call last): File "/Users/akjain/Documents/workspace/Parse13F/13FParser.py", line 26, in print dparser.parse(' Crl. A. Nos. 291/16, 300/16,…
0
votes
1 answer

Python dateutil.rrule skip every nth occurrence

It's easy to get the nth occurrence of a dateutil.rrule.rrule instance: rule = dateutil.rrule.rrule(...) occurrence = rule[15] ...But I have an occurrence such that occurrence in rule is True; I would like to know which occurrence it is (i.e. the…
Adam
  • 3,668
  • 6
  • 30
  • 55
0
votes
3 answers

Time difference with different time formats in Python3

Hi I have two times in slightly different formats and I need to work out the difference. The first was parsed from a ISO 8601 date using dateutil.parser I'm not sure what I need to do to parse them into the same format, but my two dates…
Davtho1983
  • 3,827
  • 8
  • 54
  • 105
0
votes
0 answers

python dateutils.parser.parse("0" , tzinfos={'GMT': tzutc()}) on windows give error

dateutil.parser.parse("0" , tzinfos={'GMT': tzutc()}) on windows give error ValueError: Invalid timestamp "0": day is out of range for month. python 2.7.13