Skip to content

Instantly share code, notes, and snippets.

@hasibkamal
Created December 5, 2016 06:41
Show Gist options
  • Save hasibkamal/3ed033a831f5fe3f00c5e0889cd0a9f1 to your computer and use it in GitHub Desktop.
Save hasibkamal/3ed033a831f5fe3f00c5e0889cd0a9f1 to your computer and use it in GitHub Desktop.
App\Libraries\CommonFunction::changeDateFormat(substr($alreadyExistApplicant->arrival_date, 0, 10)
public static function changeDateFormat($dateicker, $mysql = false) {
if ($mysql) {
return Carbon::createFromFormat('d-M-Y', $dateicker)->format('Y-m-d');
} else {
return Carbon::createFromFormat('Y-m-d', $dateicker)->format('d-M-Y');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment