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

Crontab not executing python file due to missing dateutil module

I have a python file which executes perfectly in shell environment, however when I try to implement it from the crontab, it doesn't execute at all.. The following code is what I run in the crontab: * * * * * /usr/bin/python3…
Rivered
  • 741
  • 7
  • 27
-1
votes
1 answer

How to fix raise ValueError("Unknown string format:", timestr) when importing excel that includes one of the fields is empty

datefield error when null with django openpyxl I want to import excel sheet but ones date fields are empty. class Drgmt(models.Model): date_ori = models.DateTimeField(default=None, null=True, blank=True) def import(request): #Many lines…
Seydina
  • 61
  • 1
  • 7
-1
votes
2 answers

Implement RRule using javascript rrule.min.js

I am trying to include the library https://github.com/jakubroztocil/rrule to my webpage. But I recieve the error: Uncaught SyntaxError: Unexpected token { I have tried with
Code Guy
  • 3,059
  • 2
  • 30
  • 74
-1
votes
1 answer

Python dateutil.parser gives "ValueError: Unknown string format"

Hi I am trying to parse date from a string using dateutil parser. But I am getting this error. Does the library accept python 'str' or 'unicode'? Does the string need any conversion? Tried with that, but no luck. enter image description here
Sachin AB
  • 1
  • 1
  • 1
-1
votes
1 answer

python dateutil -different behaviour on Linux vs. Windows

Why am I getting different results from this code on Windows vs. Linux: In [1]: from dateutil.rrule import rrule, DAILY, MONTHLY, MO, TU, WE, TH, FR In [2]: from datetime import date, datetime In [3]: r = rrule(MONTHLY, byweekday=TH(3),…
nickos556
  • 337
  • 3
  • 16
-2
votes
1 answer

`parser.parse()` - how to specify allowed formats (and it's order)

I want to create my own date parser. I like parser.parse() function but if I have: date1 = '2022/11/10' date2 = '10/11/2022' parser.parse(date1) parser.parse(date2) Then the results are: datetime.datetime(2022, 11, 10, 0,…
Merger
  • 45
  • 5
-2
votes
1 answer

python dateutil.parser ALWAYS return WRONG year as 2021?

print(dateutil.__version__) # shows 2.8.1 from dateutil.parser import parse print(parse('September 29,2019')) # datetime.datetime(2021, 9, 29, 0, 0), SHOULD BE '2019' for the year. PYTHON 3.8, WIN10 try different laptops, the same results.…
xzrc571
  • 1
  • 1
-2
votes
1 answer

Python3: Use Dateutil to make multiple vars from a long string

I have a program where I would like to randomly pull a line from a song, and string them together with other lines from other songs. Looking into I saw that the dateutil library might be able to help me parse multiple variables from a string, but it…
-2
votes
1 answer

Substitution local date or datetime for ISO 8601 in string

I try to substitute local date or datetime (+02:00) for ISO 8601 "YYYY-MM-DDTHH:MI:SSZ" (UTC) in string in python 3.x String example: x = "This is first example with dates 2019-07-01 21:30:20 and 2019-07-02 21:30:20" My code, which works fine but…
Gavko
  • 43
  • 1
  • 6
-3
votes
2 answers

Python dateutil returns YYYY-MM-DD, but I need it reversed , help please?

I've got a piece of script in python that parses a line containing date and time: d = dateutil.parser.parse("%s %s" % (m.group('date'), m.group('time')), dayfirst=True) it returns the date in YYYY-MM-DD. How can I get it to say Weekday…
Jan
  • 3
  • 1
-3
votes
1 answer

What are the differences between "import dateutil.parser" and "from dateutil.parser import parse"?

Update: I am sorry for my careless, mixing up the word parse and parser. This question should be deleted. But since someone answered it and received reputations, I kept it here. Sorry again. What are the differences between (import…
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
-4
votes
2 answers

How to roll start and end date in a month?

I want to write a function that looks ahead 1 year but can accept a certain month as the date to start counting from. For example, if the start time is 1/1/2011, then the end time is 1/1/2012. The new start time would be 1/2/2011 and new end time…
A.S
  • 305
  • 1
  • 4
  • 20
1 2 3
28
29