By InterceptPoint on
I'm running Drupal 5.0 (not 5.1) and it is solid as a rock but has this little issue with the date stamping of comments:
They all read as "Posted on December 31st, 1969".
Is this a known problem?
Is there a fix?
Am I in a Time Warp?
Comments
Try a different theme and
Try a different theme and see if it still happens. I'm guessing something in your theme (specifically node.tpl.php) might be responsible.
Doesn't seem to be theme related
I tried it with a couple of themes and it shows the correct date when previewing but still shows 1969 when posted. It looks like a bug to me. I used Garland and Golden Hour. Garland for sure should be bug-free.
Try disabling and then
Try disabling and then re-enabling comment.module
It Was the Theme After All
While in the process of turning the comment module off and on again I had a closer look at the comments. They are all dated correctly in the database. They all do in fact show correctly in Garland and a few other themes that I tried. The problem is with Golden Hour which does not pick up the date correctly for some reason. I'll try and post something to the Golden Hour guy/gal and see if it really is a bug or is something in my system.
Thanks for the help.
InterceptPoint
Golden Hour comment.tpl.php
In the Golden Hour theme's comment.tpl.php file
change:
print t('By ') . theme('username', $node) . t(' - Posted on ') . format_date($node->created, 'custom', "F jS, Y");to:
print $submitted;I'm not sure what the Golden Hour theme author is attempting to do, but the code does not work. Replacing it with the default code allows the Golden Hour theme to display the author and date properly in comments.
4.7 Custom Date Format
Just in case anyone upgrades to 5.x and used custom dates in 4.7:
The above date format used in the Golden Hour theme is a custom date format that works in 4.7 -- but apparently does not in 5.x.
It reads 'By username - Posted on Month day, Year'.
Cheers.
5.x Custom Date Format
The custom date format that the Golden Hour theme is using can be achieved with this code:
change:
to:
Cheers, again. :)
Comment.tpl.php
I ran into this problem with a Zen based custom theme—it may have been fixed for this theme by now.
But the problem is that the comment.tpl.php is calling the node created time and not the comment timestamp. They are stored in different database tables (to reduce the overhead). The author's code will work only in the node.tpl.php.
should be
I am assuming the Golden Hour Author is just customizing the formatting of the comments date.
December 31, 1969 Problem
hey all,
This might have been answered already somewhere else but i thought i would give some code to the cause.
I changed the file node.tpl.php in the theme im using. I was noticing that the preview was always showing that date but when the post was generated the correct date time was used. this was really annoying for some reason ( just anal i guess ). Anyway, heres the code that I changed.
The first div is used for all posts that have ALREADY been created. since the preview section hasn't been created yet this doesn't exist. so the second will get the current date / time for the preview.
Thanks All,
Mike