Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
datetime module question
#11
There are a lot of errors.

&Y is not a datetime format code.
mkdir {0}" is missing a starting "

The imports are all messed up:
rom datetime import datetime, date

oneday = datetime.timedelta(days-1)
yesterday = datetime.date.today() - oneday
datetime.timedelta(days-1) was probably meant to be datetime.timedelta(days=1)

You should not use \ as separators in a datetime format string. Use / or \\.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Module not found question sighhhh12 0 1,508 Sep-09-2022, 05:43 AM
Last Post: sighhhh12
  Question on subprocess module. knoxvilles_joker 3 2,708 Apr-11-2021, 12:51 AM
Last Post: knoxvilles_joker
  keyboard module question DPaul 0 2,147 Mar-23-2021, 04:22 PM
Last Post: DPaul
  TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'str' findbikash 2 9,628 Sep-18-2019, 08:32 AM
Last Post: buran
  Module googletrans 2.4.0 Question hlhp 0 2,585 Jun-17-2019, 03:50 PM
Last Post: hlhp
  Question about the Random Module Exsul 1 2,013 Mar-13-2019, 02:06 AM
Last Post: ichabod801
  Problem with datetime module PierreSoulier 3 9,323 Jul-24-2018, 11:03 AM
Last Post: perfringo
  Python Module Question ATXpython 9 9,444 Oct-09-2016, 12:59 AM
Last Post: ATXpython

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020