Created
October 8, 2016 10:07
-
-
Save sota1235/3a3cd46451a4f88e7a19dc426e6bbf3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// validation for date format according with ISO8061 | |
$date = '2016-09-30T12:00:00+900'; | |
preg_match( | |
'/^\d{1,4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](Z|(\+|-)([01][0-9]|2[0-4]):?([0-5][0-9])?)$/' | |
$date | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment