How do i convert a date string from user input to date.today() python -



How do i convert a date string from user input to date.today() python -

python newbie, need convert string user input in format dd/mm/yyyy , check see if in future?, need re order format of input comparing , convert date object.

thanks

not sure you're wanting do, take in dd/mm/yyyy , tell if it's older now.

import time # input date = input("enter date: ") # convert timestamp date_timestamp = time.mktime(time.strptime(date, "%d/%m/%y")) # check if in future if(date_timestamp > time.time()): print("it's in future,") else: print("it's not in future,")

python

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -