Date/Time
Functions:
- <?date($format,$time)>
- <?gmdate($format,$time)>
- <?time()?>
The date() function is used to display times and dates in various ways.
For example, if we wanted to print the current date and time, we might use a tag like:
- <?echo date("D M d, Y H:i:s")?>.
This would sumit like: Fri Jan 03, 2003 12:01:21 (or what ever the date and time is)
Whats all the letters about, what happens if i want it in another order, this will explain:
- Y = Year eg. 2003
- y = Year eg. 03
- M = Month eg. Jan
- m = Month eg. 01
- D = Day eg. Fri
- d = Day eg. 03
- z = Day of the year eg. 002
- H = Hours in 24 hour format eg. 07
- h = Hours in 12 hour format eg. 7
- i = Minutes eg. 29
- s = Seconds eg. 28
- U = Seconds since epoch eg. 1041604168
Thats it just a little tutiral to explain how to show the date or time in php!