-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_date.php
39 lines (26 loc) · 899 Bytes
/
test_date.php
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
36
37
38
39
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
echo date('n_Y', time());
echo "<br />";
echo date('W');
echo "<br />";
$thisYear = date('Y');
$start_week = date('W');
echo $data['start_day'] = strtotime("$thisYear-W$start_week-1");
echo "<br />";
echo $start_day = date('Y-m-d', $data['start_day']);
echo "<br />";
$lastMonth = date("n") - 1;
$thisMonth = date("n");
$nextMonth = date("n") + 1;
echo "<br />";
$thisYear = date("Y");
// Set days. mktime format: mktime(hr, min, sec, mth, day, yr)
$today = date("j");
echo $numDays = date("t", mktime(0, 0, 0, $thisMonth, 1, $thisYear)); // Number of days in current month
echo "<br />";
echo $startDay = date("w", mktime(0, 0, 0, $thisMonth, 1, $thisYear)); // Day the current month starts on