Skip to content

Instantly share code, notes, and snippets.

@amirasaran
Created December 4, 2016 15:13
Show Gist options
  • Select an option

  • Save amirasaran/708468de9d6b8bbba14d6b22cab9f20d to your computer and use it in GitHub Desktop.

Select an option

Save amirasaran/708468de9d6b8bbba14d6b22cab9f20d to your computer and use it in GitHub Desktop.

Revisions

  1. amirasaran created this gist Dec 4, 2016.
    8 changes: 8 additions & 0 deletions is_date_time
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    function is_date_time($value){
    if (preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T|\s]{1}([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/",$value))
    {
    return true;
    }else{
    return false;
    }
    }