ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DateHandlerMonth.php
Go to the documentation of this file.
1<?php
2/*
3 * @author Andreas Åkre Solberg <andreas.solberg@uninett.no>
4 * @package SimpleSAMLphp
5 */
7{
13 public function __construct($offset)
14 {
15 $this->offset = $offset;
16 }
17
18 public function toSlot($epoch, $slotsize)
19 {
20 $dsttime = $this->getDST($epoch) + $epoch;
21 $parsed = getdate($dsttime);
22 $slot = (($parsed['year'] - 2000) * 12) + $parsed['mon'] - 1;
23 return $slot;
24 }
25
26 public function fromSlot($slot, $slotsize)
27 {
28 $month = ($slot % 12);
29 $year = 2000 + floor($slot / 12);
30 return mktime(0, 0, 0, $month + 1, 1, $year);
31 }
32
33 public function prettyHeader($from, $to, $slotsize, $dateformat)
34 {
35 $month = ($from % 12) + 1;
36 $year = 2000 + floor($from / 12);
37 return $year . '-' . $month;
38 }
39}
An exception for terminatinating execution or to throw for unit testing.
prettyHeader($from, $to, $slotsize, $dateformat)
$from