forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdates.php
More file actions
35 lines (22 loc) · 682 Bytes
/
dates.php
File metadata and controls
35 lines (22 loc) · 682 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
<?php
// $concertDate = new Date('1993-5-12');
// echo($concertDate);
// $date = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
// echo $date->format('Y-m-d');
// $concertDate = new Date('1993-5-12');
// echo($concertDate);
// $date = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
// echo $date->format('Y-m-d');
echo ("<h1>Dates on PHP</h1>");
echo("<h2>Create Date</h2>");
$concertDate = date_create("1992-12-5");
echo date_format($concertDate, "Y/m/d");
echo("<h2>Current Date</h2>");
echo(date('Y-m-d'));
echo("<h2>Current Day</h2>");
echo(date('d'));
echo("<h2>Current Month</h2>");
echo(date('m'));
echo("<h2>Current Minute</h2>");
echo(date('i'));
?>