Subversion Repositories eFlore/Applications.cel

Rev

Rev 1778 | Rev 1781 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1778 Rev 1779
Line 604... Line 604...
604
			// et on essaie d'être sympa et supporter aussi DD/MM/YYYY
604
			// et on essaie d'être sympa et supporter aussi DD/MM/YYYY
605
			if(preg_match(';^([0-3]?\d)/([01]\d)/([12]\d\d\d)$;', $date, $matches)) {
605
			if(preg_match(';^([0-3]?\d)/([01]\d)/([12]\d\d\d)$;', $date, $matches)) {
606
				$date = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
606
				$date = $matches[3] . '/' . $matches[2] . '/' . $matches[1];
607
			}
607
			}
608
			$timestamp = strtotime($date);
608
			$timestamp = strtotime($date);
609
			if(! $timestamp) {
609
			if(! $timestamp || $timestamp > time() + 3600 * 24 * 1) { // une journée d'avance maxi autorisée (décallage horaire ?)
610
				if($date) trigger_error("ligne \"{$ref_ligne}\": Attention: date erronée ($date)", E_USER_NOTICE);
610
				if($date) trigger_error("ligne \"{$ref_ligne}\": Attention: date erronée ($date)", E_USER_NOTICE);
611
				return NULL;
611
				return NULL;
612
			}
612
			}
613
			return strftime("%Y-%m-%d 00:00:00", $timestamp);
613
			return strftime("%Y-%m-%d 00:00:00", $timestamp);
614
		}
614
		}