CSmith1128 Posted May 24, 2006 Share Posted May 24, 2006 Hello... I need some help with dates...I had the user input a date using 3 different for fields.When the submit it, i have 3 variable, one for month, one for day, and one for year.Each one has a number that represents the mont, day and year.For example, January 1, 2006 would be stored like this..$month = 1, $day = 1, $year = 2006I need to do two things.I already have validation for the correct number of days in each month.However, I need to check whether the date they entered has not passed already.To do this, I need to get the current date.How would I get the current date and separate each part of it into separate variables for month, day, and year?Also, after I validate each component, how would I convert the date back into the following format...2006-05-23Could someone please help?Thanks,Chris Quote Link to comment https://forums.phpfreaks.com/topic/10311-need-help-with-dates/ Share on other sites More sharing options...
.josh Posted May 24, 2006 Share Posted May 24, 2006 look into time() and mktime() Quote Link to comment https://forums.phpfreaks.com/topic/10311-need-help-with-dates/#findComment-38449 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.