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
0 answers

getting this error "ImportError: dateutil 2.5.0 is the minimum required version" ruuning IBridgePY

when I run the RUN_ME.py file from Ibridgepy folder on python 2.7 on Mac OS X ver 10.9.5 terminal, I get this error ImportError: dateutil 2.5.0 is the minimum required version I have installed dateutil 2.5.0 using pip install python-dateutil==2.5.0,…
0
votes
0 answers

Python problem in converting any string date into YYYYMMDD format

I am creating desktop application using python i want to convert any incoming sting date format in yyyymmdd format i am using following code to convert date in desired format but this is not working. anydate = "09-12-2020 12:00:00" parsedate =…
siya
  • 43
  • 8
0
votes
1 answer

How to differentiate between a dateutil parsed date and a datetime with 0 for all time values

As far as I can tell there is no way to distinguish the difference between these two date strings ('2020-10-07', '2020-10-07T00:00:00') once they are parsed by dateutil. I really would like to be able to tell the difference between a standalone date…
nickrl21
  • 96
  • 6
0
votes
1 answer

DateLocator in matplotlib to show the first days of both the week and the month

I would like to create a DateLocator in matplotlib that selects all Mondays and the first days of the month. As matplotlib uses the dateutil library I read the docs of how to use RRuleLocator with rrule objects. With the rruleset object from…
MrTJ
  • 13,064
  • 4
  • 41
  • 63
0
votes
1 answer

Input string recognise text and return date parse

I have a string input where text contains data as "monday of next month" or "4 days before new year" need to convert into dates as suppose today is 25/11/2020, so next month monday is on 07/12/2020, so how should i do it in python (i've tried using…
0
votes
1 answer

how to add days to django annotate date field from already built annotation

my model looks like this class Model(models.Model): user_id = models.ForeignKey() date = models.DateField() field1 = models.FloatField() field2 = models.FloatField() I have a below queryset queryset =…
Jagrut Trivedi
  • 1,271
  • 14
  • 18
0
votes
1 answer

Converting multi language date time formats to "%Y-%m-%d"

I'm scraping a references from the bottom of pages on wikipedia. These references contain an OpenUrl link which I can parse. Here's an example:
TheMightyLlama
  • 1,243
  • 1
  • 19
  • 51
0
votes
0 answers

dateutil seems to give wrong timezone

I use datetime and dateutil to get my current UTC offset and time zone like this: >>> from datetime import datetime >>> from dateutil.tz import tzlocal >>> >>> current_time = datetime.now(tzlocal()) >>> print('Your UTC offset is…
HelloGoodbye
  • 3,624
  • 8
  • 42
  • 57
0
votes
1 answer

Python time zones: Why is EST off by one hour? (pytz / dateutil)

I'm trying to print the current time in EST, but my results are off by one hour (when compared to Google's "est local time" and "nyc local time"). I've tried using both pytz and dateutil: import datetime import dateutil.tz import pytz #…
cadabra
  • 288
  • 2
  • 7
0
votes
1 answer

Convert datetime.datetime from UTC to CEST one hour to less

If I run the following code I convert the datetime.datetime from utc to cest, but it does not work right. Correct would be if it would change from 21:29 to 23:29 because the time difference is 2 hours from_zone = tz.gettz('UTC') to_zone =…
padul
  • 134
  • 11
0
votes
1 answer

Unknown string format pd.to_datetime in Python. Having issues trying to convert this format to a datetime format

My column headers in my DF are of the following format --> df_weather.columns ['Max-09-23', 'Min-09-23', 'Max-09-24', 'Min-09-24', 'Max-09-25', 'Min-09-25', 'Max-09-26', 'Min-09-26', 'Max-09-27', 'Min-09-27', 'Max-09-28', 'Min-09-28',…
0
votes
1 answer

Python Read data from txt file using find all method for timestamps

I am reading data from txt file. It is listing the data between #### and ####. If there is same timestamps last two lines, workflow select the first one and separating it. When I print data in console(Print data:), you can see that there is a gap in…
nobody
  • 33
  • 4
0
votes
1 answer

How to get the last Saturday-Friday week in a month with at least 4 days in the month

I'm trying to get the start/end dates of the 7-day date range where the following are true (given a month and year): Starts on a Saturday Ends on the following Friday Has at least 4 of its 7 days in the given month (meaning up to 3 can be in the…
Ben Soyka
  • 816
  • 10
  • 25
0
votes
1 answer

Usage of fuzzy_with_tokens in dateutil parser

Recently while working in an NLP project I used dateutil parser. Many have used fuzzy_with_tokens while parsing like parse(dtstr, fuzzy_with_tokens=True) What is the purpose of fuzzy_with_tokens? What it will do?
0
votes
1 answer

How to make a naive datetime aware with dateutil.tz?

Currently if I want to convert a naive datetime to an aware one, I do it as follows: from datetime import datetime import pytz pytz_tz = pytz.timezone('Europe/London') naive_datetime = datetime(2020, 1, 5, 10, 12) aware_datetime =…
Newskooler
  • 3,973
  • 7
  • 46
  • 84