Python Forum
convert strings of date to datetime exported from CSV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert strings of date to datetime exported from CSV
#1
Hello.
I am using python3 to export some date from a csv file.
I have a csv file full of dates in the form of dd/mm/yyyy
Suppose that I have two strings s1='31/10/2019' and s2='20/09/2019' that I got from the csv file
how can I convert those two strings to datetime objects so that I can subtract them and get the days pass between those two dates
Thank you!
Reply


Messages In This Thread
convert strings of date to datetime exported from CSV - by GiorgosPap31 - Oct-31-2019, 02:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compare current date on calendar with date format file name Fioravanti 1 279 Mar-26-2024, 08:23 AM
Last Post: Pedroski55
  Python date format changes to date & time 1418 4 660 Jan-20-2024, 04:45 AM
Last Post: 1418
  Trying to understand strings and lists of strings Konstantin23 2 803 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  Review my code: convert a HTTP date header to a datetime object stevendaprano 1 2,033 Dec-17-2022, 12:24 AM
Last Post: snippsat
  Convert Date to another format lonesoac0 2 1,687 Mar-17-2022, 11:26 AM
Last Post: DeaD_EyE
  Splitting strings in list of strings jesse68 3 1,813 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  Filter dataframe by datetime.date column glidecode 2 5,246 Dec-05-2021, 12:51 AM
Last Post: glidecode
  Date format and past date check function Turtle 5 4,330 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,256 Feb-06-2021, 10:48 PM
Last Post: eddywinch82
  Convert date integers (ex. 43831) to regular format Galven 2 2,662 Nov-15-2020, 11:38 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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