Python Forum
convert date input to seconds
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert date input to seconds
#3
The time module is pretty rad:

>>> import time
>>> parsed = time.strptime("DAY 3, 09:00 PM", "DAY %d, %I:%M %p")
>>> parsed
time.struct_time(tm_year=1900, tm_mon=1, tm_mday=3, tm_hour=21, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=3, tm_isdst=-1)
Reply


Messages In This Thread
convert date input to seconds - by student001 - Mar-07-2017, 02:16 AM
RE: convert date input to seconds - by ichabod801 - Mar-07-2017, 02:22 AM
RE: convert date input to seconds - by nilamo - Mar-24-2017, 04:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare current date on calendar with date format file name Fioravanti 1 255 Mar-26-2024, 08:23 AM
Last Post: Pedroski55
  Python date format changes to date & time 1418 4 628 Jan-20-2024, 04:45 AM
Last Post: 1418
  Review my code: convert a HTTP date header to a datetime object stevendaprano 1 2,013 Dec-17-2022, 12:24 AM
Last Post: snippsat
  Problem with module time and leap seconds Pedroski55 3 1,259 Oct-07-2022, 11:27 PM
Last Post: Pedroski55
  Convert Date to another format lonesoac0 2 1,681 Mar-17-2022, 11:26 AM
Last Post: DeaD_EyE
  Store variable data and display sum after 60 seconds the_dude 11 3,471 Dec-16-2021, 07:07 PM
Last Post: deanhystad
  Date format and past date check function Turtle 5 4,290 Oct-22-2021, 09:45 PM
Last Post: deanhystad
  How to add previous date infront of every unique customer id's invoice date ur_enegmatic 1 2,246 Feb-06-2021, 10:48 PM
Last Post: eddywinch82
  Convert date integers (ex. 43831) to regular format Galven 2 2,644 Nov-15-2020, 11:38 PM
Last Post: bowlofred
  How to add date and years(integer) to get a date NG0824 4 2,899 Sep-03-2020, 02:25 PM
Last Post: NG0824

Forum Jump:

User Panel Messages

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