Created
December 8, 2014 11:57
-
-
Save kostaspt/efac2ee3b7c902972c8a to your computer and use it in GitHub Desktop.
Convert OADate to DateTime format
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 | |
use Carbon\Carbon; | |
public function oaDateToFormat($OADate, $format = 'Y-m-d H:i:s') | |
{ | |
$date = Carbon::createFromFormat('Y-m-d H:i:s', '1899-12-30 00:00:00'); | |
$date->addSeconds($OADate * 24 * 60 * 60); | |
return $date->format($format); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment