A
A
abuamr2016-09-21 18:42:12
PHP
abuamr, 2016-09-21 18:42:12

I get timezone, how do I get time from it?

I get the timezone (Europe/Moscow) using jstz
, how will I get the time? from walking from the received time zone ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Julia Kovalenko, 2016-09-21
@abuamr

<?php
$date = new DateTime("now", new DateTimeZone('America/New_York') );
echo $date->format('Ymd H:i:s');

E
entermix, 2016-09-21
@entermix

date_default_timezone_set('Europe/Moscow');
echo date('d.m.Y H:i);

But jstz is a JavaScript library...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question