OkFx.Net, get rebates from your trade

PHP Date format

For create date at PHP we use The PHP Date() Function

The PHP date() function formats a timestamp to a more readable date and time

date(”format”)

Format Parameter :

Parameter Description
a for “am” or “pm”
A “AM” or “PM”
d The day of the month (01-31)
D Name of day, start from Sunday, just 3 char, ex : “Fri”
m The current month, as a number (01-12)
F Name of month, full word, like “January”
M name of month, just 3 char, like “Feb”
n The current month, as a number, without “0″( 1-12 )
Y The current year in four digits, like : 2008
y The current year in two digits, like : 08

Using at PHP Code :

<html>
<body>
<?php
echo date(”Y/m/d”);
echo “<br />”;
echo date(”Y.m.d”);
echo “<br />”;
echo date(”y-m-d”);
echo “<br />”;
echo “today is “. date(”F d, Y”);
?>
</body>
</html>

And output will shown like this ( If today is 2008/05/03)

2008/05/03
2008.05.03
08-05-03
today is May 03, 2008

One Response to “PHP Date format”

  1. Forcescript.com – PHP Include File Says:

    [...] Forcescript.com Learn script php for making website « PHP Date format [...]


  2. forex robot Says:

    wow. thumbs up from the reader. this is an interesting post.


  3. forex robot trader Says:

    Hello. I enjoyed your well written post. I bookmarked this one to digg. regards


Leave a Reply