I'm building a simple date verification script and I just stumbled onto a big problem.
$correct_date = FALSE;
if ($legal_month == $month_wozero || $legal_month == $month_wzero) {
if ($legal_day == $day_wzero || $legal_day == $day_wozero) {
if ($legal_year == $year)
$correct_date = TRUE;
}
}
$legal_day, $legal_month, $legal_year = user input
$day_wozero/wzero, $month_wozero/wzero, $year = server time
The user needs to enter the date in which they placed the order. But clearly, this is never going to work with the way I’ve setup my script. The location of the business is -2 hours from the server. But that doesn't matter since someone can place the order anywhere with in the United States. So if they are in New York, it could be the next day, and the business being in LA, the dates would differ. Also It could be the last day of the month and the month in New York would differ as well from LA.
The only way around this is in my head is to build an entire if/else nested set of rules to adjust for time and month difference at specific times. But I'm almost sure there has to be another way around this that I'm not aware of.
Any suggestions?