Answer the question
In order to leave comments, you need to log in
What is the correct way to convert timestamp to string?
This is most likely a very noob question, but I can't find what's wrong.
The docs say that the date function accepts a UNIX timestamp as an integer:
The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given.
echo date('Y-m-d h:i:s', 1438369615);
echo date('Y-m-d h:i:s', 1438326415);
Answer the question
In order to leave comments, you need to log in
H, not h.
H - 24format
h - 12 format, still need to deliver ap/pm (a/A)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question