-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.php
More file actions
35 lines (24 loc) · 819 Bytes
/
date.php
File metadata and controls
35 lines (24 loc) · 819 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
29
30
31
32
33
34
35
<?php
echo date('d'); //Day
echo date('m'); //Month
echo date('Y'); //Year
echo date('l'); //Day of the week
echo date('Y/m/d');
echo date('m-d-Y');
echo date('h'); //Hour
echo date('i'); //Minuts
echo date('s'); //Seconds
echo date('a'); //AM or PM
//Set Time Zone
date_default_timezone_set('America/New_York');
echo date('h:i:sa');
$timestamp = mktime(10, 14, 54, 9, 10, 1981);
echo $timestamp;
echo date('m/d/Y h:i:sa', $timestamp);
$timestamp2 = strtotime('7:00pm March 22 2016');
$timestamp3 = strtotime('tomorrow');
$timestamp4 = strtotime('next Sunday');
$timestamp5 = strtotime('+2 Months');
echo $timestamp2;
echo date('m/d/Y h:i:sa', $timestamp4);
?>