Skip to content

Instantly share code, notes, and snippets.

@kostaspt
Created December 8, 2014 11:57
Show Gist options
  • Save kostaspt/efac2ee3b7c902972c8a to your computer and use it in GitHub Desktop.
Save kostaspt/efac2ee3b7c902972c8a to your computer and use it in GitHub Desktop.
Convert OADate to DateTime format
<?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