Jump to content

[SOLVED] Convert from 4-digit to 2-digit year


ainoy31

Recommended Posts

Hello-

 

I am trying to convert from a 4-digit to a 2-digit year.  Here is my code:

 

$date = "2007-10-02";

$explode_date = explode("-", $date);

 

echo $new_date = $explode_date[1].$explode_date[2].$explode_date[0];

 

The result is 10022007 but I need it to be 100207(mmddyy).  Any suggestion is much appreciated.  AM

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.