Hi,
I got a scenario where the user gets an id which will expire in 24 hours. Now for that validation I need to update a field ie., set expiration time for 24 hours from the current time.
When the user logs in with that userid I need to check whether the id has expired or still valid. How do I set the time. Can I get some code please.
I got two functions which converts string to date and date to string
private String dateToStringCon version(Date date) {
String ldapDate = null;
SimpleDateForma t ldapFormat =
new SimpleDateForma t("yyyyMMdd") ;
ldapDate = ldapFormat.form at(date);
return ldapDate;
}
private Date stringToDateCon version(String value) {
Date date = null;
SimpleDateForma t ldapFormat =
new SimpleDateForma t("yyyyMMdd") ;
date = ldapFormat.pars e(value);
return date;
}
But how to set time ie., validate a field for 24 hours.......Ple ase give me some code....
Regards
Kamal
I got a scenario where the user gets an id which will expire in 24 hours. Now for that validation I need to update a field ie., set expiration time for 24 hours from the current time.
When the user logs in with that userid I need to check whether the id has expired or still valid. How do I set the time. Can I get some code please.
I got two functions which converts string to date and date to string
private String dateToStringCon version(Date date) {
String ldapDate = null;
SimpleDateForma t ldapFormat =
new SimpleDateForma t("yyyyMMdd") ;
ldapDate = ldapFormat.form at(date);
return ldapDate;
}
private Date stringToDateCon version(String value) {
Date date = null;
SimpleDateForma t ldapFormat =
new SimpleDateForma t("yyyyMMdd") ;
date = ldapFormat.pars e(value);
return date;
}
But how to set time ie., validate a field for 24 hours.......Ple ase give me some code....
Regards
Kamal
Comment