Jump to content

how to add +GTM 80:00??


UnrEALMe

Recommended Posts

<?php
$time = time(); //get timestamp
$date = date('H:i:s', $time); //get time with timestamp
$newtime = strtotime($date.' +0800', $time); //get new timestamp with 8h difference
echo date('Y-m-d H:i:s', $time).' - '.date('Y-m-d H:i:s', $newtime);
?>

Link to comment
Share on other sites

what's wrong with it?

2007-05-17 16:53:52
2007-05-17 08:53:52

Maybe you don't see the result:

First you see the normal date and then you see the changed time

change

echo date('Y-m-d H:i:s', $time).' - '.date('Y-m-d H:i:s', $newtime);

to

echo date('Y-m-d H:i:s', $newtime);

and it only shows you the new time with +0800

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.