-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path14 Date and Time Functions.php
More file actions
28 lines (26 loc) · 965 Bytes
/
14 Date and Time Functions.php
File metadata and controls
28 lines (26 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!-- PHP Date and Time Functions -->
<title>PHP Date and Time Functions</title>
<?php
#Set Time Zone
date_default_timezone_set("Asia/Kolkata");
#Get Time Zone
echo date_default_timezone_get();
echo "<hr>";
#Date
echo "Day (01 - 31) : " . date("d") . "<br>";
echo "Month (01 - 12) : " . date("m") . "<br>";
echo "Year (Four Digits) : " . date("Y") . "<br>";
echo "Year (Two Digits) : " . date("y") . "<br>";
echo "Day of the Week : " . date("l") . "<br>";
echo "Date : " . date("d-m-Y") . "<br>";
echo "<hr>";
#Time
echo "Hour (00 - 23) : " . date("H") . "<br>";
echo "Hour (01 - 12) : " . date("h") . "<br>";
echo "Minutes (00 - 59) : " . date("i") . "<br>";
echo "Seconds (00 - 59) : " . date("s") . "<br>";
echo "Lowercase Ante meridiem and Post meridiem (am - pm) : " . date("a") . "<br>";
echo "Uppercase Ante meridiem and Post meridiem (AM - PM) : " . date("A") . "<br>";
echo "Time : " . date("H:i:s") . "<br>";
echo "Time : " . date("h:i:s:A") . "<br>";
?>