Answer the question
In order to leave comments, you need to log in
How to work with date in Unicode format?
I work with the bank's API, and there the date / time comes in Unicode format: $authDateTime = 1530083933281
I rummaged through everything, I just can't figure out how to process this string. Or is it just a timeStamp with some kind of timezone?
Answer the question
In order to leave comments, you need to log in
1. Correct Unicode e - it hurts your eyes
2. It's not clear what kind of Unicode we are talking about. It seems that this is a regular timestamp, but extra numbers have been added to the right. Most likely there is an error somewhere: either in yours or in the service API. You can try to simply cut them off (substr).
$authDateTime = 1530083933281;
echo date('d-m-Y H:i:s', time($authDateTime + (60 * 60)));
The last three digits are milliseconds, date does not understand them, so you need to cut them off.echo date('d-m-Y H:i:s', $authDateTime / 3);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question