Page 1 of 1

Separate year from date format

Posted: Fri Mar 13, 2009 8:18 am
by dv_evan
Dear All,

I have already attempted searching for this issue but came up with nothing.
I am extracting records from MySQL, I have the dates in the date field in the format dd/mm/yr, which was enter from a normal registration form.

I would like to display the 'yr' (year only) from the dd/mm/yr field.

eg: Name/ Address / Year instead of Name/Address/Date
Can you assist in helping me solve this problem please.

Regards
Dave

Re: Separate year from date format

Posted: Fri Mar 13, 2009 8:36 am
by elpepefontana
list($day,$month,$year) = explode("/",$date);
print $year;

Re: Separate year from date format

Posted: Fri Mar 13, 2009 9:21 am
by dv_evan
Thanks elpepefontana for your response.

Best Regards
Dave

Re: Separate year from date format

Posted: Fri Mar 13, 2009 10:08 am
by pickle
Please don't double post. Locking topic.