T
T
toster2712014-11-01 16:38:32
PHP
toster271, 2014-11-01 16:38:32

How to convert time without exact date?

Good afternoon
Reading about working with date and time zones, I found out that there are several difficulties with converting inaccurate dates.
The data is in the profile of registered user No. 1.
time "13:00".
This user's time zone is "Europe/London".
User #2 has a different time zone, for example "Europe/Moscow".
The time from the profile of the first should be shown taking into account the current time zone, i.e. "15:00".
To do the converter only on php I think it will be unprofitable.
Therefore, I paid attention to momentjs .
I would like to understand how to use it in my case.
Also, is there an alternative?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
toster271, 2014-11-17
@toster271

I was already writing my plugin, but it turned out that it already exists and the code for obtaining the result is simple.
https://github.com/moment/moment/issues/2029

T
toxa82, 2014-11-02
@toxa82

Look at php.net/manual/ru/class.datetime.php I think it will help you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question