XeroOAuth-PHP
XeroOAuth-PHP copied to clipboard
Invoice Payment dates are returned in .NET DataContractJsonSerializer format
Ultimately this is more a fault of the API itself, but it would be helpful if the library converted these dates to ISO format for us.
Has been an ongoing issue in the forums for 4+ (!!!!!) years now
An easy solution would only have to be a few lines of code (referenced from here):
preg_match('~(\d+)\d{3}((?:\+|-)\d+)~', $date, $match);
$dt = new DateTime('@' . $match[1]);
$dt = new DateTime($dt->format('Y-m-d H:i:s') . ' ' . $match[2]);
$date = strtotime($dt->format('r'));