By shaiss on
I've created a customer php page to display users in a set format given that they are in the teachers group.
http://ride4.org/beacon/?q=node/5
I've added the custom fields. In particular I've added a "Date Employed" field which in the DB the value is a:3:{s:5:"month";s:1:"5";s:3:"day";s:2:"25";s:4:"year";s:4:"2006";}
I need to take this date and convert it to a standard m/d/yy date.
I tried http://drupal.org/node/75598 but that just gave an error saying that the function expects a long value
Is there an easy way to take this value in the DB and convert it to the standard date format?
Comments
Serialized
That data object is a serialized array. Use unserialize(), then you can use mktime() and pass the results to format_date().
--
http://ken.therickards.com
I did this... <?php// Get
I did this...
Thanks to http://drupal.org/node/202092 for retreiving the profile field.
Easier
Ah I discoved there's a simpler way to get the profile fields loaded - call profile_load_profile()
e.g.
Date?
Are you using the date module? IF you are using the standard User Profile, what you might consider to save some time down the road (possibly) is to use the Content Profile Module. This will turn your user profiles into content nodes. From there, you can apply a Date CCK field.