Jump to content

Recommended Posts

I have a website that's obviously hosted on an EST timezone machine.  Our website is time-based with quite a number of features, but we are in CST.  This is an hour less than, or an hour behind, the server the website resides on.  Is there a way to have <?php echo mosCurrentDate(); ?> modified so that it will have an hour less, or the correct current date and time of the CST timezone instead of the EST timezone?  Thanks so much for all input.
If your using a unix timestamp,

[code]<?php
//** from php manual, not mine. Since we made need negative bases
function npow($base, $exp)
{
  $result = pow(abs($base), $exp);
  if ($exp % 2 !== 0) {
      $result = - ($result);
  }
  return $result;
}

function ModifyTimeStamp($timestamp, $hours, $minutes, $seconds)
{
return ($timestamp + npow($hours, 3) + npow($minutes, 2) + $seconds);
}
?>[/code]

, else show us the code your using to display/calculate the date.

hth.
the output for "echo strtotime("-1 hour", strtotime(mosCurrentDate()));" gives 1161695160 instead of a time/date...  not sure why?

<td valign="top"><div align="left" class="date"><?php echo strtotime("-1 hour", strtotime(mosCurrentDate())); ?></div></td>
what's the way the date should correctly show.

take a look at the date funciton here http://www.php.net/date

and use this whole statement as the second argument
for instance
[code=php:0]
date("Y-m-d:h:m:s", strtotime("-1 hour", strtotime(mosCurrentDate())));
[/code]
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.