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.

Comments

a_godin’s picture

Here's what Devel, template_node_preprocess and the database tell me ...

For a content type with the datetime "2015-01-08 15:07", timezone America/Montreal -5 hours :
- Devel gives me
"2015-01-08 20:07:00" for ['my_field']['#items'][0]['value']
"Thursday 08 January 2015 - 15 h 01" for ['my_field'][0]['#markup']

- dpm($vars) in template_preprocess_node(&$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']
"Thursday 08 January 2015 - 15 h 01" for ['elements']['my_field'][0]['#markup']
" jeu, 08-01-2015 - 15 h 01" for ['date']

The database has the value "2015-01-08 20:07:00" for the field

I don't understand why the time that Drupal gives me to print is 15 h 01 instead of 15 h 07 ...

a_godin’s picture

Status: Active » Closed (works as designed)

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

My bad !