I'm building a site for a small daily newspaper in ProsePoint. I would like to be able to display a "timestamp" on stories -- on the Story page and on the teaser that appears on the Channel/Edition pages. I would like for the "timestamp" to reflect "last updated" time for the story -- which needs to be either the time that the Edition went "live" or the last time the story was updated since the Edition went live (if the story was published as part of the Edition and then updated after that).
I know very little about PHP, but I did have some code that someone had suggested in another project, so I tried using that code to create a content-field-field_time.tpl.php file for the "Time" field that I created; here is the pertinent snippet of code:
<?php
$displayTime =date("g:i", $node->changed);
if (date("G", $node->changed) >= 12) {
$displayTime .= ' p.m.';
} else {
$displayTime .= ' a.m.';
}
echo $displayTime;
?>The problem with this code is that the time it displays is in the timezone of the server hosting the site -- which is on the West Coast, while the newspaper is on the East Coast. So the time displayed is off by three hours.
(The timezone for the website I'm building is set correctly in Administer > Date and time to "America/New York.")
Any thoughts?