date("d");
Finding the current Day of the month, 2 digits with leading zeros.
<?php
$absolute = date("d");
print $absolute;
?>
|
Other Parameters are used in the date function |
||
|---|---|---|
| format character | Description | Example returned values |
| ------------------ | ---------------- | --------------- |
| Day | ||
| d | Day of the month, 2 digits with leading zeros | 01 to 31 |
| D | A textual representation of a day, three letters | Mon through Sun |
| l (lowercase 'L') | A full textual representation of the day of the week | Sunday through Saturday |
| S | English ordinal suffix for the day of the month, | 2 characters st, nd, rd or th |
| Month | ||
| m | Numeric representation of a month, with leading zeros | 01 through 12 |
| M | A short textual representation of a month, three letters | Jan through Dec |
| Year | ||
| Y | A full numeric representation of a year, 4 digits | Examples: 1999 or 2009 |
| y | A two digit representation of a year | Examples: 99 or 09 |
| Time | ||
| a | Lowercase Ante meridiem and Post meridiem | am or pm |
| A | Uppercase Ante meridiem and Post meridiem | AM or PM |
| g | 12-hour format of an hour without leading zeros | 1 through 12 |
| h | 12-hour format of an hour with leading zeros | 01 through 12 |
| i | Minutes with leading zeros | 00 to 59 |
| s | Seconds, with leading zeros | 00 through 59 |
getdate();
Returns an associative array containing the date information of the timestamp, or the current local time if no timestamp is given.
<?php
$today = getdate();
print_r($today);
?>
checkdate(15,35,2006);
Checks the specified date in the argument is valid or not.
<?php
print checkdate(12,15,2008);
?>
| After editing Click here: |
Output:
|
|
Hello World
|