Change Date Format in PHP


date_default_timezone_set('Asia/Calcutta');
$date = '2006-01-24';
echo date('d-M-Y', strtotime($date)); // outputs 24-Jan-2006
echo date('dMY', strtotime($date)); // outputs 24Jan2006

Posted in Mixz Tricks, PHP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 442 other followers

%d bloggers like this: