How can we keep time limit for change of password.

Asked by Santhosh Motamarry

How can we keep time limit for change of password.

Eg: In my application if i change my password today at 10 am of time and again i need to get a chance to change it again after 24 hours i.e., the next day same time 10 am in this 24hours user should not able to change his current password.

How can we write script for this.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

You have to save the time somehow together with the password.

time handling as such:

start = time.time() # current time with base seconds

At any one time afterwards you can check

if time.time() - start > (24 * 60 * 60):
    print "change possible"
else:
    print "change not possible"

Revision history for this message
Santhosh Motamarry (santhosh-motamarry) said :
#2

Thanks RaiMan, that solved my question.