Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Invoice Payment dates are returned in .NET DataContractJsonSerializer format #59

Open
schmoove opened this issue Jun 1, 2016 · 0 comments

Comments

@schmoove
Copy link

schmoove commented Jun 1, 2016

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'));
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant