-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalendar.php
More file actions
34 lines (23 loc) · 830 Bytes
/
calendar.php
File metadata and controls
34 lines (23 loc) · 830 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
<?php
use Punic\Calendar;
include 'vendor/autoload.php';
$dt = Calendar::toDateTime('2010-03-07');
// This will output 'AD'
echo Calendar::getEraName(1);
// This will output 'Mar'
echo Calendar::getMonthName($dt, 'abbreviated');
// This will output 'marzo'
echo Calendar::getMonthName($dt, 'wide', 'it');
// This will output 'Monday'
echo Calendar::getWeekdayName(1);
// This will output '1st quarter'
echo Calendar::getQuarterName(1);
// This will output '7 März 2010'
echo Calendar::format($dt, 'd MMMM y', 'de');
// This will output 'domenica 7 marzo 2010'
echo Calendar::formatDate($dt, 'full', 'it');
// This will output '7/3/2010'
echo Calendar::formatDate($dt, '~yMd', 'da');
// This will output 'Mar 7 – 10, 2010'
$dt2 = Calendar::toDateTime('2010-03-10');
echo Calendar::formatInterval($dt, $dt2, 'yMMMd');