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
1 answer

Get data of previous months data in python django

Hi I am using django and my model look like this class SignupMonthlyPoint(models.Model): user = models.ForeignKey(Profile, on_delete=models.CASCADE, related_name='SignupMonthlyPoints') timestamp = models.DateTimeField(auto_now_add=True) …
gamer
  • 603
  • 4
  • 20
0
votes
2 answers

More pythonic way to parse some values from a few elements from a list?

Is there a more pythonic way to write this code? this field_split variable becomes part of a mysql statement. I need to reformat these 5 time fields using dateutil.parser.parse and make the field None if the timestamp value was empty in the incoming…
personalt
  • 810
  • 3
  • 13
  • 26
0
votes
1 answer

Unable to download dateutil, Environment Error

Trying to download dateutil to run a python script. I've tried installing it via pip and pip3, but it appears to be calling the wrong python environment. Used: pip install python-dateutil==1.4 and got the following: ERROR: Could not install packages…
Mlapolla2
  • 9
  • 1
0
votes
2 answers

How to format a date to a specific format in python?

I have a datetime from below generated code from datetime import datetime from pytz import timezone tz = timezone('US/Pacific') print(datetime.now(tz)) # 2019-06-17 05:41:22.189735-07:00 I am looking for this format of output "Wed, 17 Jun 2019…
Ashwin S
  • 165
  • 2
  • 11
0
votes
1 answer

dateutil.parser - separate hours and minutes with dot

I use the dateutil.parser.parse function to recognize a date entered by a user. Normally hours and minutes are separated by a double point but sometimes a user enters something like 6.30pm which is parsed to 18:00. So the minutes are just…
flappix
  • 2,038
  • 17
  • 28
0
votes
1 answer

Convert any time string to INDIAN time or INDIA time and date (convert string to indian timezone) using Python3

I have a simple problem to convert any kind of date time string into INDIAN date time string or you can say convert to Indian timezone but unable to find an exact approach
0
votes
1 answer

How to handle sum and multiplication of time intervals?

I need to calculate deadline(datetime) after adding N(int) intervals (represented by relativedelta, because it can be months or years and also in seconds or dates). I can do it simply by multiplying interval by N and summing it to…
0
votes
1 answer

Trying to search excel file for a date

Im searching for a date in excel using a string that I've converted to python date. I get a error trying to convert excel values to date using the following code: from dateutil import parser import xlrd d = '4/8/2019' dt_obj =…
dkisiale
  • 35
  • 4
0
votes
0 answers

Information lost while parsing time using dateutil in python

I have an input which may contain a date, or time, or both. In case the date is provided I can use that date but in case the date is not provided (i.e. only the time is provided) then I have to use a different date provided from someplace else. But…
guroosh
  • 642
  • 6
  • 18
0
votes
1 answer

Uninstalling and RE-Installing python-dateutil

I was getting an error while accessing my jupyter notebook which was a syntax error in dateutil module so I uninstalled it using pip uninstall pyhton-dateutil and then while installing it again using pip install python-dateutil I got this…
0
votes
0 answers

Error with DateUtil.Parser : cannot import name 'isoparse'

I am trying to execute the following code, but I get the error "ImportError: can not import name 'isoparse'". I tried installing python-dateutil but the error persist. The code is from https://github.com/yannforget/pylandsat from datetime import…
0
votes
1 answer

Python date with offset conversion to non-offset

from dateutil.parser import parse from dateutil.relativedelta import relativedelta from dateutil.tz import gettz from datetime import datetime, timedelta input_time = '2019-02-01 09:50:08+11:00' parsed=parse(input_time) …
takobaba
  • 306
  • 1
  • 4
  • 15
0
votes
2 answers

Change timestamp from dateutil from utc to not utc

What exists import datetime import dateutil.parser import time timestamp = dateutil.parser.parse(response["body"]["inserted_at"]) Whats the problem This timestamp is UTC, but it should be UTC+1, or TimeZone Europe,Zurich Question What shall I add…
Gamsner
  • 117
  • 1
  • 9
0
votes
3 answers

ImportError: dateutil 2.5.0 is the minimum required version

I'm facing this issue while trying to use pandas package. I have installed numpy 1.9.0 and installed dateutil 2.5.0 using the command pip install python-dateutil==2.5.0. Still I see this error. Is there any other way to install dateutil? And this…
Ric
  • 1
  • 1
  • 2
0
votes
1 answer

Converting Dates in different format (objects) in DataFrame

I am new here, I apologize if the layout is not typical. I have a large csv with around 150,000 rows. The Date column alternates between two formats, but it always increases in increments of 10 minutes. First 2001-02-08 2:30:00 AM -- %Y-%m-%d…
TAbbs
  • 1
  • 1