A
A
Alexey Yarkov2015-10-01 20:28:56
PHP
Alexey Yarkov, 2015-10-01 20:28:56

How to get normal date?

Wrote a Chrome bookmark file parser. There, the date_added value is represented as 13085694682797540. I'm trying to translate it into a convenient form using PHP like this:

echo date("H:m:s d-m-Y", 13085694682797540);
// на выходе видим
// 12:12:00 26-12-414671126

Not what you need))) Has anyone come across this? How to decrypt?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-10-01
@yarkov

The date function takes a time in seconds as its second argument .

function normalizeChromiumTime($time) {
    return ($time - 11644473600000000) / 1000000;
}
echo date("H:m:s d-m-Y", normalizeChromiumTime(13088196284767072));
// Время моей закладки. 21:10:44 01-10-2015

echo date("H:m:s d-m-Y", normalizeChromiumTime(13085694682797540));
// Время вашей 22:09:22 02-09-2015   (2 сентября - точно пару дней назад?)

UPD: wrote and did not check
UPD: I went to Google ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question