By blarg on
I have users that have each created a profile. In this profile they note their date of birth. These are all showing everywhere as:
1970-05-10 H:i
Obviously we don't care about the hours and seconds. In the configuration I see a short date format that includes hours and seconds, but none are availiable that don't have this. Which db table is this format stored in so I can axe the H:i or is there an easier way to accomplish this?
Comments
More research
I found the date formats in the variable table, but the short format is:
YYYY-MM-DD - H:i
Note the dash in the middle. So I looked at the profile fields and the date is stored like:
a:3:{s:4:"year";s:4:"1983";s:5:"month";s:1:"4";s:3:"day";s:2:"27";}
I don't know what the letter:number is for, but this is obviously getting fed through a date-prettier-upper that isn't the main one, because I set the date formats to year-month-day with nothing else and we still showed H:i. I did turn the cache off to make sure that wasn't the issue.
Profile module bug?
What version of Drupal are you running?
In the function profile_view_field of profile.module, there is a section that formats the date.
In 4.6.5, it looks like this:
and in 4.7:
It appears it replaces all the tags for the m/d/y/h/i values with its own variables. The 4.6.5 version is lacking the 'H:i' => null line so the H:i tag isn't being replaced(removed, since replaces with null)...and simply gets sent through.
Try adding that line in:
Drupal 4.6.6
Drupal 4.6.6, and that section of code in my profile.module looks like:
Changing it as you suggest has resolved the issue.