I'm trying to create some date recurrence rules. Based on the issues with dateutil noted here and here I am trying to use relativedelta rather than rr ...
I'm trying to create some date recurrence rules. Based on the issues with dateutil noted here and here I am trying to use relativedelta rather than rr ...
I am trying to convert a column called Month_Next from a dataframe called df_actual from the last day of one month to the first day of the next. The c ...
If I want to find the number of hours between two datetime objects, I can do something like this: from datetime import datetime today = datetime.tod ...
Is there any way that I can summarise the following code? The codes after each if-else condition are very similar. The only difference is the argument ...
enter image description here The code I wrote above works fine except I want the numerical day (%d) of the month to stay unchanged (30th) for all the ...
I'm trying to shift a tz-aware timestamp for one month. Since datetime.timedelta does not have a month option, package relativedelta should be used. ...
I want subtract 1 month from a date. I'm using relativedelta but this subtract 6 months. I get this result : instead of : ...
Using the df below, I am trying to determine a new date using dateutil.relativedelta.relativedelta but would like to iterate through df['freq'] and df ...
I have a list myList that contains relativedelta objects. I want to add all of these relativedeltas objects. I tried: but it gives TypeError. Ev ...
Why the output of this relativedelta attribute is also zero? The data file contains two date time strings, the purpose is to get the time difference b ...
I am not sure how to go about constructing datetime object given year, month, week_of_month and day_of_week. Any clues? Using this I am trying to achi ...
I am using relativedelta to calculate difference between two dates. However, it seems like the year part of the datetime object isn't being recognized ...
I am filtering a dataframe by dates to produce two seperate versions: Data from only today's date Data from the last two years However, when ...
I try to create a list of year-month from 2020-06 (last month from today) to 2021-05 using the following code: Out: But as you may noticed, ther ...
I am trying to add x number of days or months or years to today’s date, where both x and the frequency are supplied by the user. I have looked at dat ...
Im trying to provide dynamic value to relativedelta function, i.e relativedelta(days=1) i would like to assign dynamic function value days, months, ye ...
I have 2 columns in a dataset of 327 records: And I want to generate a third one (['theoretical_eoc']) that gives me the dates kept in [JD] plus a ...
I'm looking to build code that represents the definition of months in a piece of Australian legislation - the Interpretations Act (1987). Please not ...
I have a dataframe with the date and month_diff variable. I would like to get a new date (name it as Target_Date) based on the following logic: For ...
I'm using the following method to create the object stated in the title: However, I would like to simplify this so that I can just pass and the ...