Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Time question
#11
First, fix the syntax errors. The interpreter is telling you it doesn't understand what you're trying to do. t==8,3,0 isn't valid code, and it doesn't make sense to compare a datetime to a tuple.

8,3,0 is just a tuple. If you expect it to have more meaning, you need to let python know what meaning you're applying to that. And you do that exactly the same way you're already doing it earlier in the program: o = datetime.time(8,3,0)
Reply
#12
Sorry I still don't get it. The tutor told me I need to use strptime. Not sure what that is but ok.
I'm taking two columns from a csv file ('open' and 'close'). I need to find the differnce between the two by subtracting the closing time from the opening time. They are written in my csv in the standard 24hform (8:30:00).

I feel i am Wall with this question
Reply


Forum Jump:

User Panel Messages

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