Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How can I format a "Java-Date" in seconds since 1970 to an dd.mm.yyyy HH:MM:SS in php. I have this date as an variable in php:
$date = "1362065364128";
$date = "1362065364128"; $phpDate = date('d.m.y H:i:s', $date/1000);
Add a comment
It's called a unix timestamp, and you can pass it as the second argument to the date function in php-
date
You can use the PHP method date, note that the three last numbers are milliseconds here, so you need to disregard them first.
$date = "1362065364128"; $formatted = date('Y-m-d H:i:s', intval($date) / 1000);
Use the PHP date function, documentation here
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.