|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
change user date to db date
alright... I was wondering...
is it possible that a user enter a date and then have a page check that date against the current time, and perform an action if that time has past? I need to let a user add a time in the future, and then check it against the current date. This may be a dumb question, but I can't figure it out since the users entry is not going to be a timestamp or anything, since that would be jsut a current time... how can I do this? thanks!
__________________
hey it's the CHARKING |
|
#2
|
||||
|
||||
|
You haven't described your problem very clearly. Is it a date or a time we're dealing with here (or both)? If you validate the user input properly (using select boxes rather than text entry, for example), you should be able to compare both the date and time against substrings of the system time. Check out the DATE_FORMAT() function in mysql (for pulling out formatted date and time strings from date/time fields, the FROM_UNIXTIME() function (also in mysql) and the mktime() and date() functions in PHP.
|
|
#3
|
|||
|
|||
|
sorry
okay I jsut realized that date works. Sorry I didn't explain myself clearly eniough. Thank you very much!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > change user date to db date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|