Home Square Enix Forums Topsites Links Affiliation Staff About History of HHN Hell and Heaven Net
Feature: History of Final Fantasy

Final Fantasy series

  • Final Fantasy VII
  • Advent Children
  • Dirge of Cerberus
  • Crisis Core
  • Final Fantasy VIII
  • Final Fantasy IX
  • Final Fantasy X
  • Final Fantasy X-2
  • Final Fantasy XI
  • Final Fantasy XII
  • Final Fantasy XIII
  • Final Fantasy Versus XIII
  • Final Fantasy XIV

Other games

  • Kingdom Hearts
  • Kingdom Hearts II
  • Grandia
  • Grandia II
  • Grandia III
  • Star Ocean III
  • Star Ocean: The Last Hope
  • The Last Remnant
  • Legend of Dragoon

The Website

  • Home
  • News Archive
  • Reviews
  • Affiliation
  • Blacklist
  • History of HHN
  • About Us / FAQ
  • Staff
  • Credits
  • Contact Us
  • Link to Us
  • Links

Interaction

  • Forums
  • Topsites
  • HHN Radio
  • Al Bhed Translator
  • Tic Tac Toe
  • Release Dates

Multimedia

  • Flash Movies
  • Movies & Trailers
  • Music
  • Roms & Emulators
  • Screensavers
  • Winamp Skins

Webmaster Stuff

  • Tutorials
  • PHP Scripts
  • Free Layouts
  • Free Buttons
  • Free Banners
  • Free Hosted Scripts
  • Free Hosts

Affiliates

  • Final Fantasy Mages
  • Final Fantasy Nemesis
  • Final Fantasy Source
  • Final Fantasy Union
  • Final Fantasy XIII
  • Sound-Test
  • Square Anthology

Network

  • Dragon Ball Kai .NL
  • South Park Fan

» Tutorials » Insert Date using PHP

This little tutorial will go about inserting date and/or time into a webpage using PHP. This is better than using Javascript, because the code is smaller and it doens't require javascript to be installed.

To include a date into a webpage, insert this code. The file's extension must be .php.

<?
$date = date("l, j F Y");
echo $date;
?>

If you insert this you'll get: Tuesday, 7 February 2012. You can change it of course to with you like. Here's a list with all the available codes.

Letter Output
a Gives "am" or "pm".
A Gives "AM" of "PM".
B Swatch Internet time ("000" till "999")
d Day of the Month, from 01 till 31.
D Day of the week, in 3 letters, example Mon, Wed etc.
F Month full out, so "January", "March" etc.
g Hours, in 12-hoursformat, example 4 or 8.
G Hours, in 24-hoursformat, example 8 or 19.
h Hours, in 12-hoursformat, example 04 or 08.
H Hours, in 24-hoursformat, example 08 or 19.
i Minutes, from 01 to 60.
I Displays "1" when Daylight Saving Time, otherwise "0".
j Number of the day of the month, example 1 of 17.
l Day of week full out, for example "Monday", "Wednesday" etc.
L Whether it's a leap year. 1 = Yes, 0 = No.
m Month in number, for example 01 or 10.
M Month in 3 letters, so "Jan" or "Feb".
n Month in numbers, so 1 or 10.
O Difference in Greenwich-time, for example "+0100" of "+0200".
r Full date, example: "Mon, 12 Feb 2003 14:22:50 +0200".
s Seconds, example 01 of 35.
S "st", "nd" of "rd".
t The number of days that the current month has, so 28, 29, 30 or 31.
T Time zone setting of this machine (so CET).
U Seconds since the Unix Epoch.
w Day of the week, in numbers, from 0 to 6 (0 = Sunday).
W ISO-8601 week number of the year, week starts on Monday.
y Year in two numbers, example 01 or 03.
Y Year in four numbers, example 2001 or 2003.
z Day of the year, from 0 to 365.
Z Time zone offset in seconds.

If you have any problems with this, feel free to contact me by using the contact form.

Final Fantasy Topsites Final Fantasy Mages Topsites Final Fantasy Otaku Topsites