-
A journey leads to php....
And now, for a quick tangent...
More about the “DATE” command - it is very versatile and flexible - see the guide below to use it to it’s potential!
And now...back to Variables!
The DATE command
Expanding on the above example, here are the options for DATE and TIME display:
Time:
- a: am or pm
- A: AM or PM
- g: Hour without leading zeroes (1-12)
- G: Hour in military time without leading zeroes (0-23)
- h: Hour with leading zeroes (01-12)
- H: Hour in military time with leading zeroes (00-23)
- i: Minute with leading zeroes (00-59)
- s: Seconds with leading zeroes (00-59)
Days:
- d: Day of the month with leading zeroes (01-31)
- j: Day of the month without leading zeroes (1-31)
- D: Day of the week abbreviations (Sun – Sat)
- I: Day of the week (Sunday – Saturday)
- w: Day of the week without leading zeroes (0-6)
- z: Day of the year without leading zeroes (1-365)
Months:
- m: Month of the year with leading zeroes (01-12)
- n: Month of the year without leading zeroes (1-12)
- M: Month abbreviations (Jan – Dec)
- F: Month names (January – December)
- t: Number of days in the month (28-31)
Years:
- L: Displays 1 if it is a leap year, 0 if not
- Y: Year in 4-digit format (2006)
- y: Year in 2-digit format (06)
- Other Date Formats:
- r: Full date, including timestamp and timezone offset (O)
- U: Number of seconds since the Unix Epoch (Jan. 1, 1970)
- O: Offset difference from Greenwich Meridian Time (GMT). 100 = 1 hour, -100 = -1 hour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks