Skip to content

Instantly share code, notes, and snippets.

@michaeltwofish
Created August 12, 2011 05:14
Show Gist options
  • Save michaeltwofish/1141501 to your computer and use it in GitHub Desktop.
Save michaeltwofish/1141501 to your computer and use it in GitHub Desktop.
// Format the date field, leaving invalid dates alone
if ($candidate->dob != null) {
// Check if the entered date is valid
if (strtotime($candidate->dob)) {
$candidate->dob = date("d/m/Y", strtotime($candidate->dob));
}
} else {
$candidate->dob = "some new placeholder";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment