Jump to content

need help with dates...


CSmith1128

Recommended Posts

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 = 2006

I 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-23


Could someone please help?

Thanks,
Chris
Link to comment
https://forums.phpfreaks.com/topic/10311-need-help-with-dates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.