python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to generate the next six months?
I'm trying to create this template.
Expect to receive September 30, 2022 or October 1, 2022
But I get the next year the same day!
>>> datetime.today()
datetime.datetime(2022, 3, 31, 9, 21, 49...
Sh VavilenT
Votes: 0
Answers: 3
How to make dateutil.parse() still be agnostic to format, but require day, month and year from the string?
I use dateutil.parse() to parse out datetime strings from a file. Once in a while these strings are not actual date times. All kinds of things can be there.
My trouble is that parse() gives me false p...
Fontanka16
Votes: 0
Answers: 0
Python extract date with different formats from a string
I tried package dateutil to extract date part from string. It works good if the exact date included in the string, like:
from dateutil.parser import parse
try:
date = parse(string, fuzzy=True)
...
Sam S.
Votes: 0
Answers: 1
Relativedelta 28 february and 29 february
I have the following code:
import datetime
from dateutil.relativedelta import relativedelta
date_1=datetime.date(2000,2,28)+relativedelta(years=+1)
date_2=datetime.date(2000,2,29)+relativedelta(years=...
michael
Votes: 0
Answers: 0