Is there anything in the script which could cause it to not run its full course please?

ozstar1 at gmail.com ozstar1 at gmail.com
Mon May 4 20:17:02 EDT 2020


On Tuesday, 5 May 2020 01:35:42 UTC+10, David Raymond  wrote:
> Not necessarily the cause of your problem, but if you're going to compare dates it should be as objects, or as text as year-month-day. Here you're comparing dates as text in day-month-year format. So January first 9999 comes before May 4th 2020
> 
> "01-01-9999" < "04-05-2020"
> 
> ...
> 04-05-2020 09:30:00 40
> 04-05-2020 12:30:00 40
> 04-05-2020 15:30:00 40
> 04-05-2020 22:30:00 40
> ...
> input_date,input_time,input_duration=date_time_duration.split(' ')
> current_datetime = datetime.datetime.now()
> current_date = current_datetime.strftime('%d-%m-%Y')
> if(input_date>=current_date):
>    while(True):
> ...

Thank you, see what you mean. I have corrected this now.


More information about the Python-list mailing list