python-dateutil Questions
12
Solved
Following this answer I tried to get the date for last Thursday of the current month. But my code doesn't get out of loop.
from datetime import datetime
from dateutil.relativedelta import relative...
Republic asked 2/5, 2016 at 6:4
4
Solved
I am using Python 2.7 and trying to use dateutil as follows:
from dateutil import parser as _date_parser
However, I get the following error:
Traceback (most recent call last):
File "<pyshel...
Absorbefacient asked 24/2, 2014 at 14:27
4
Solved
Is there an elegant was to convert between relativedelta and timedelta?
The use case is getting user input ISO date. Python's isodate will return either isodate.duration.Duration or datetime.timed...
Wino asked 7/6, 2013 at 6:38
5
Solved
I have a string that has several date values in it, and I want to parse them all out. The string is natural language, so the best thing I've found so far is dateutil.
Unfortunately, if a string h...
Blazer asked 11/8, 2011 at 15:33
3
Solved
I set
locale.setlocale(locale.LC_TIME, ('de', 'UTF-8'))
the string to parse is:
Montag, 11. April 2016 19:35:57
I use:
note_date = parser.parse(result.group(2))
but get the following error...
Heiney asked 27/5, 2016 at 13:48
2
I am running Mypy v0.910 with pre-commit. It complains that python-dateutil does not have type stubs. However, even after installing the stubs, I get the same error.
My pre-commit config is
default...
Briquet asked 20/10, 2021 at 0:24
5
Dateutil is a great tool for parsing dates in string format. for example
from dateutil.parser import parse
parse("Tue, 01 Oct 2013 14:26:00 -0300")
returns
datetime.datetime(2013, 10, 1, 14, 2...
Eliciaelicit asked 12/11, 2013 at 11:14
2
Solved
I am new to Python and also dateutil module. I am passing the following arguments:
disclosure_start_date = resultsDict['fd_disclosure_start_date']
disclosure_end_date = datetime.datetime.now()
dis...
Microphone asked 12/7, 2016 at 11:59
4
I installed Python-Dateutil package, but when i import it in my script , it's throwing error:
import dateutil
ImportError: No module named 'dateutil'
when i checked the lib folder, dateutil.eggs...
Penultimate asked 15/12, 2017 at 13:52
4
Solved
I am doing some time calculations in Python.
Goal:
Part of this is trying to :
Given a date, add time interval (X years, X months, X weeks), return date
ie
input args: input_time (datetime.date), ...
Chartist asked 28/1, 2019 at 0:56
2
Solved
I have several CSV files with the format:
Year,Day,Hour,Min,Sec.,P1'S1
2003, 1, 0, 0,12.22, 0.541
2003, 1, 1, 0,20.69, 0.708
2003, 1, 2, 0, 4.95, 0.520
2003, 1, 3, 0,13.42, 0.539
...
(where ...
Ellingson asked 4/9, 2012 at 18:43
4
Solved
See the following code:
import datetime
import pytz
fmt = '%Y-%m-%d %H:%M:%S %Z'
d = datetime.datetime.now(pytz.timezone("America/New_York"))
d_string = d.strftime(fmt)
d2 = datetime.datetime.s...
Thais asked 7/2, 2013 at 22:46
5
I'm running the jupyter notebook (Enthought Canopy python distribution 2.7) on Mac OSX (v 10.13.6). When I try to import pandas (import pandas as pd), I am getting the complaint: ImportError: dateu...
Diatropism asked 23/7, 2018 at 0:44
8
Solved
I am trying to install the SciPy stack located at https://scipy.org/stackspec.html [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but ...
Gasparo asked 15/8, 2014 at 14:59
5
Solved
I'm trying to implement timezone awareness in my Python application, and I have come across two different Python modules that implement this feature: pytz and python-dateutil. What is the dif...
Halfmoon asked 18/3, 2012 at 2:35
6
Solved
Is there a way to get the "format" after parsing a date in dateutil. For example something like:
>>> x = parse("2014-01-01 00:12:12")
datetime.datetime(2014, 1, 1, 0, 12, 12)
x.get_origi...
Desolation asked 22/12, 2018 at 1:49
1
Solved
I've been trying to parse recurrence rules using python's dateutil rrule package
However, I am getting an odd error inconsistent with the way I understand recurrence rules
The error is
ValueErr...
Tessellation asked 1/1, 2019 at 16:37
3
I wish to get the total duration of a relativedelta in terms of days.
Expected:
dateutil.timedelta(1 month, 24 days) -> dateutil.timedelta(55 days)
What I tried:
dateutil.timedelta(1 month...
Title asked 12/1, 2015 at 18:2
3
I tried to install python dateutil for my django tastypie but unsuccessful,
http://labix.org/python-dateutil#head-2f49784d6b27bae60cde1cff6a535663cf87497b
I downloaded the tar file in c:/python27...
Elveraelves asked 15/8, 2012 at 0:34
5
Solved
Here's my data
Customer_id Date-of-birth
1 1992-07-02
2 1991-07-03
Here's my code
import datetime as dt
df['now'] = dt.datetime.now()
df['age'] = df['now'].dt.date - df['Date-of-birth']
Here'...
Gielgud asked 24/7, 2018 at 6:31
4
Solved
This should be very simple, but I can't quite figure it out in Python.
I want to have a function which takes two arguments, a UTC time in seconds and a zoneinfo name like 'Europe/Vienna' and return...
Xenophanes asked 2/10, 2012 at 13:20
4
Solved
I'd like to add one month to a given date
import datetime
dt = datetime.datetime(year=2014, month=5, day=2)
so I should get
datetime.datetime(year=2014, month=6, day=2)
but with
dt = datetim...
Satirical asked 28/1, 2015 at 9:45
2
I'm trying to open Jupyter Notebook with Anaconda navigator (on Mac OSX) and I cannot open it properly. I keep getting this message in my terminal.
File "/System/Library/Frameworks/Python.framewo...
Violoncello asked 7/10, 2017 at 0:39
4
Solved
Hello I am trying to use relativedelta from the dateutil module.
I want to do what is mentioned here, add some months to a given datetime object.
But I'm trying to use Python 3 for this and I am ...
Saxon asked 5/8, 2016 at 14:49
3
Solved
How can I convert a dateutil.relativedelta object to a datetime.timedelta object?
e.g.,
# pip install python-dateutil
from dateutil.relativedelta import relativedelta
from datetime import timede...
Revis asked 1/1, 2015 at 6:30
1 Next >
© 2022 - 2024 — McMap. All rights reserved.