tags:

views:

100

answers:

3

I'm wondering how to make the datelines looks like the same.

e.g

2007-7, 200707 => 2007-07

Thanks!

A: 

Use date:

echo date('Y-m', time());
soulmerge
+1  A: 

use a combination of strtotime and date:

 echo date('Y-m', strtotime($your_dateline));
knittl
A: 

You can try with below script...

echo date('Y-m', date());

           or 

echo date("M-d-Y", mktime(0, 0, 0, 7, 0, 2007));
VAC-Prabhu