1
In some applications I use C#
, when I return the value in JSON
, the object DateTime
is serialized to a weird format, more or less like this:
/Date(1504020443813-0300)/
And I’ll get it in PHP.
When I receive this value in PHP, I will need to convert it to the object DateTime
.
So how can I convert this format there to DateTime
PHP? Already have something native to PHP, or have to use regex
or things like?
Is that https://stackoverflow.com/a/46120602/1518921 ? In case it converts to a format validated by "ISO" and pass via string, then PHP will understand in the use of Datetime ;)
– Guilherme Nascimento
https://answall.com/q/305454/112052
– hkotsubo
@hkotsubo essa seria melhor https://answall.com/a/285942/3635 - the answer you linked solves in PHP, which I found a disastrous solution
– Guilherme Nascimento
@Thiagomagalhães see my previous comment
– Guilherme Nascimento
Short solution: https://ideone.com/nFROOE
– Bacco