Client LoginView your Shopping CartHelp & Frequently Asked QuestionsEmail Us
Home Services Portfolio Web Design Pricing Dreamweaver Templates Web Applications Free Tutorials About Contact Us
Services > CSS Web Design | Professional Logo Design | ASP.net, ASP & PHP Programming | Flash Animation & Programming | Reliable Web Hosting | Website Maintenance
Portfolio > Web Design Portfolio | Web Programming Portfolio | Logo Design Portfolio | Web Design Pricing > Custom Web Design | Logo Design | Business Card Design
Web Design Guide > Website Design w/ Dreamweaver & Fireworks | Fireworks CS4 Cool Features | Photo Effects | Text Effects | Graphic Design Ideas | Web Design Ideas
Website Navigation Ideas | CSS Styles Tutorial | Dreamweaver Template | Server Side Includes | Flash Tutorials > Flash Effects | Flash Sound Button | Sound On/Off Button
Flash Preloader | Import External Data | Promotion > SEO Tips | Google Tips & Page Rank | JavaScript > Date Validation | Email Validation | Phone Validation | Tip Boxes

PHP Date Function Tips

In this Tutorial you will learn some Tips on PHP Date Functions - formats, syntax and output.

Format with Result Syntax Output
a Displays "am" or "pm" echo date('d-m-y a'); 23-04-05 pm
A Displays "AM" or "PM" echo date('d-m-y A'); 23-04-05 PM
d Displays day of the month with leading 0 that is "01" to "31" echo date('d'); 23
D Displays day of the week with 3 characters. echo date('D'); Sat
F Displays day of the week with full text. echo date('d-F-y A'); 23-April-05 PM
h Displays the hour format is "01" to "12". echo date('h A '); 02 PM
H Displays the hour format is "01" to "23". echo date('H A '); 14 PM
g Displays the hour without leading 0 format is "1" to "12". echo date('g A '); 2 PM
G Displays the hour without leading 0 format is "0" to "23". echo date('G A '); 14 PM
i Displays the minutes format is "00" to "59". echo date('H : i A '); 14 : 34 PM
j Displays day of the month without leading 0 format is "1" to "31". echo date('j-m-y'); 23-04-05
l Displays day of the week with long text format is "Friday". echo date('l-m-y'); Saturday-04-05
L Returns the boolean value whether it is leap year or not. echo date('l-m-y L');
0 - False
1 - True
Saturday-04-05 0
m Displays the month format is "01" to "12". echo date('m'); 04
n Displays the month without leading 0 format is "1" to "12". echo date('n'); 4
M Displays the month with 3 characters format is "Jan". echo date('M'); Apr
s Displays the seconds "00" to "59". echo date('s'); 41
S English ordinal suffix with 2 characters "th" "nd". echo date('d - m - y S'); 23 - 04 - 05 rd
t number of days in the given month. echo date('t'); 30
w shows the numeric value of the day of the week 0(Sunday) to 6(Saturday). echo date('w l'); 6 Saturday
Y shows the year with 4 digits format"2005". echo date('Y'); 2005
y shows the year with 2 digits format"05". echo date('y'); 05

Absolutely FREE Web Templates
Check out these quality free web templates and download them without any registration or sign-up!

FREE Web Design Guide
From web design tips & ideas to HTML, CSS Styles, Fireworks & Dreamweaver you'll find all you need to know about effective web site design right here!

Quality Dreamweaver Templates
Professional quality dreamweaver templates in over 20 categories, starting at just $9.95! Instant download & easy customization

Beauty Templates | Business Templates | Christian Templates | CSS Templates | Education Templates | Family Templates | Flash Templates | Free Dreamweaver Templates
Food Templates | General Templates | Government Templates | Health/Medical Templates | Hi-Tech Templates | Kids/Childcare Templates | Low-cost Budget Templates
Personal Templates | Pets Templates | Photography Templates | Profession Templates | Real Estate Templates | Sports Templates | Telecom Templates | Travel Templates
Free Tutorials > Web Design Tutorials | CSS Web Design | Fireworks Tutorials | Dreamweaver Tutorials | Flash Tutorials | SEO Tutorials | Javascript Tutorials | PHP Tutorials