0

I have a weird bug. On many content types, I have a Date field using the Pop-up calendar widget with the format "February 3 2014 - 2:35".

When that date is displayed, the minutes are never the same as the minutes that I entered when I saved my content. If my date field has the time value 4:15, the time displayed will be 4:12. If I change the minutes again for let's say, 4:52, the time displayed is still 4:12. And when I edit that content, the time I entered is still there, so I know it's saved correctly. If I change the hour, that change is displayed properly but the minutes stay the same.

Also, when I check recent log messages, for a given hour, the minutes displayed are always the same. Like every event that happened between 2PM and 3PM has the time 2h02.

Does anybody know what the problem might be ?

I'm on Drupal 7.34 and using Date 7.x-2.8.

closed as off-topic by kiamlaluno Feb 6 '15 at 3:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced, was solved by a cache clear, or was a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers." – kiamlaluno
If this question can be reworded to fit the rules in the help center, please edit the question.

  • What's in the database? What does Devel show about that field? – Kari Kääriäinen Feb 4 '15 at 3:05
  • For a content type with the datetime "2015-01-08 15:07", Devel gives me "2015-01-08 20:07:00" for ['my_field']['#items'][0]['value'] and "<span class="date-display-single">Thursday 08 January 2015 - 15 h 01</span>" for ['my_field'][0]['#markup']. – agodin Feb 4 '15 at 20:38
  • In template_preprocess_node(&$vars), dpm($vars) gives me "2015-01-08 20:07:00" for ['my_field'][0]['value'], "2015-01-08 20:07:00" for ['elements']['my_field']['#items'][0]['value'], "<span class="date-display-single">Thursday 08 January 2015 - 15 h 01</span>" for ['elements']['my_field'][0]['#markup'] and " jeu, 08-01-2015 - 15 h 01" for ['date']. – agodin Feb 4 '15 at 20:48
  • The database has the value "2015-01-08 20:07:00". – agodin Feb 4 '15 at 20:57
  • The timezone is timezone America/Montreal -5 hours – agodin Feb 4 '15 at 21:10
-1

Well, turns out the discrepancy was due to a bad date format ... I was using "m" for the minutes instead of "i".

My bad !

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