Thursday, December 15, 2011

Php Date format examples

echo date("D - m/d/y"); // Wed - 12/14/11

echo date("l - \T\h\e jS \d\a\y \of F"); // Wednesday - The 14th day of December

echo date('l \t\h\e jS'); // Wednesday the 15th

echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000)); // July 1, 2000 is on a Saturday

echo date('l jS \of F Y h:i:s A'); // Monday 8th of August 2005 03:12:46 PM

echo date("l"); // Monday

echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)); // 2000-07-01T00:00:00+00:00

echo date(DATE_RFC822); // Mon, 15 Aug 2005 15:12:46 UTC

echo date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm

echo date("m.d.y"); // 03.10.01

echo date("j, n, Y"); // 10, 3, 2001

echo date("Ymd"); // 20010310

echo date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01

echo date('\i\t \i\s \t\h\e jS \d\a\y.'); // it is the 10th day.

echo date("D M j G:i:s T Y"); // Sat Mar 10 17:16:18 MST 2001

echo date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:18 m is month

echo date("H:i:s"); // 17:16:18

echo date( "F jS, Y ",strtotime("2011-12-14 11:23:20")); // December 5th, 2011

No comments:

Post a Comment