Posted By

xekonic on 03/22/10


form date shorthand conversion long

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Convert Shorthand Date to Long Form

 / Published in: PHP

Frequently I like to make data more user friendly, so while I make it easy for them to add a date as a shorthand format (mm/dd/yyyy) I like to return it as something easier to digest (Day of Month in Year, etc). This is the simplest way to do that I've found

  1. list($day, $month, $year) = split('/', $date);
  2. echo date('l, F jS ', mktime(0, 0, 0, $month, $day, $year));

Report this snippet  

You need to login to post a comment.