1

I am trying to do something like:

My instance Locale default Timezone zone is Taipei Standard Time (Asia/Taipei) For a particular case,I want to get my current time in Tokyo Standard Time (Asia/Tokyo) time. How can i do this?Please help.

Suppose $order->getCreatedAt() give order creation time.

I would like something like:

$CurrentimeTaipeAsia=$order->getCreatedAt();
$currenttimeinTokyo=Mytimeconvert($order->getCreatedAt());

$currenttimeinTokyo give order create time in Tokyo time .

1
  • Thanks.. Kayur..But your solution is not works.I was give you upvote
    – Amit Bera
    May 6, 2015 at 8:24

1 Answer 1

3

You can do using DateTimeZone

$date = new DateTime('7:10pm', new DateTimeZone('America/Montreal'));

$date->setTimezone(new DateTimeZone('Europe/Paris'));

echo $date->format('Y-m-d H:i:sP');

just pass your timezone

which returns

2013-06-14 01:10:00+02:00 

Read more about PHP and timezones here: http://www.php.net/manual/en/datetime.settimezone.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.