E
E
Evgeny Ivanov2018-03-15 10:21:06
PHP
Evgeny Ivanov, 2018-03-15 10:21:06

How to generate a timestamp?

The server is adding data to the database every 5 minutes.
Each entry contains a value and a time. The time is just a timestamp time();
Record example 1 1521061200.
The dedicated server is in a different time zone. Its time cannot be changed (virtualization conditions). And when viewing the records, I add the time difference.
I have it 5 hours i.e. +18000 seconds.
Now I see entries in my local time.
I need to display entries from the previous day, two days ago, etc. relative to the current date.
For example, today is 03/15/2018 (current date). I need records ending with the previous day.
Those. display all records where the time is less than 03/14/2018 24:00:00.
Generate such a timestamp.
How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2018-03-15
@logpol32

where `date` < UNIX_TIMESTAMP(CURDATE())

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question