D
D
deniska_kuzmenko2015-11-03 14:32:48
PHP
deniska_kuzmenko, 2015-11-03 14:32:48

Problem with timestamp output?

There is one timestamp, I display it on different domains, the result is:
1 domain - echo date('dmY H:i:s', 1421234567); - 01/14/2015 14:22:47
2 domain - echo date('dmY H:i:s', 1421234567); - 01/14/2015 15:22:47
that is, the difference is 1 hour, I don’t know, maybe the settings are different there, well, for some reason I can’t understand how this can be, I thought that the timestamp is not affected by settings such as timezone, etc., why output at different times?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Lyzlov, 2015-11-03
@dixoNich

Well, how do they not affect it?
https://en.wikipedia.org/wiki/UNIX-%D0%B2%D1%80%D0...
At 00:00:00 UTC on January 1, 1970 (Thursday), UNIX time is zero.
Everyone has different time settings on the machine, after all. You need to save time with a shift.

I
Ivanq, 2015-11-03
@Ivanq

Actually, it does.
Set first in code
date_default_timezone_set("Europe/Moscow");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question