This file is indexed.

/usr/share/php/Calendar/Calendar.php is in php-calendar 0.5.5-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Contains the Calendar and Calendar_Engine_Factory classes
 *
 * PHP versions 4 and 5
 *
 * LICENSE: Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Date and Time
 * @package   Calendar
 * @author    Harry Fuecks <hfuecks@phppatterns.com>
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @version   CVS: $Id: Calendar.php 300729 2010-06-24 12:05:53Z quipo $
 * @link      http://pear.php.net/package/Calendar
 */

/**
 * Allows Calendar include path to be redefined
 */
if (!defined('CALENDAR_ROOT')) {
    define('CALENDAR_ROOT', 'Calendar'.DIRECTORY_SEPARATOR);
}

/**
 * Constant which defines the calculation engine to use
 */
if (!defined('CALENDAR_ENGINE')) {
    define('CALENDAR_ENGINE', 'UnixTS');
}

/**
 * Define Calendar Month states
 */
define('CALENDAR_USE_MONTH',          1);
define('CALENDAR_USE_MONTH_WEEKDAYS', 2);
define('CALENDAR_USE_MONTH_WEEKS',    3);

/**
 * Contains a factory method to return a Singleton instance of a class
 * implementing the Calendar_Engine_Interface.<br>
 * <b>Note:</b> this class must be modified to "register" alternative
 * Calendar_Engines. The engine used can be controlled with the constant
 * CALENDAR_ENGINE
 *
 * @category  Date and Time
 * @package   Calendar
 * @author    Harry Fuecks <hfuecks@phppatterns.com>
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @link      http://pear.php.net/package/Calendar
 * @see       Calendar_Engine_Interface
 * @access    protected
 */
class Calendar_Engine_Factory
{
    /**
     * Returns an instance of the engine
     *
     * @return object instance of a calendar calculation engine
     * @access protected
     */
    function & getEngine()
    {
        static $engine = false;
        switch (CALENDAR_ENGINE) {
        case 'PearDate':
            $class = 'Calendar_Engine_PearDate';
            break;
        case 'UnixTS':
        default:
            $class = 'Calendar_Engine_UnixTS';
            break;
        }
        if (!$engine) {
            if (!class_exists($class)) {
                include_once CALENDAR_ROOT.'Engine'.DIRECTORY_SEPARATOR.CALENDAR_ENGINE.'.php';
            }
            $engine = new $class;
        }
        return $engine;
    }
}

/**
 * Base class for Calendar API. This class should not be instantiated directly.
 *
 * @category  Date and Time
 * @package   Calendar
 * @author    Harry Fuecks <hfuecks@phppatterns.com>
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @copyright 2003-2007 Harry Fuecks, Lorenzo Alberton
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @link      http://pear.php.net/package/Calendar
 * @abstract
 */
class Calendar
{
    /**
     * Instance of class implementing calendar engine interface
     * @var object
     * @access private
     */
    var $cE;

    /**
     * Instance of Calendar_Validator (lazy initialized when isValid() or
     * getValidor() is called
     * @var Calendar_Validator
     * @access private
     */
    var $validator;

    /**
     * Year for this calendar object e.g. 2003
     * @access private
     * @var int
     */
    var $year;

    /**
     * Month for this calendar object e.g. 9
     * @access private
     * @var int
     */
    var $month;

    /**
     * Day of month for this calendar object e.g. 23
     * @access private
     * @var int
     */
    var $day;

    /**
     * Hour of day for this calendar object e.g. 13
     * @access private
     * @var int
     */
    var $hour;

    /**
     * Minute of hour this calendar object e.g. 46
     * @access private
     * @var int
     */
    var $minute;

    /**
     * Second of minute this calendar object e.g. 34
     * @access private
     * @var int
     */
    var $second;

    /**
     * Marks this calendar object as selected (e.g. 'today')
     * @access private
     * @var boolean
     */
    var $selected = false;

    /**
     * Collection of child calendar objects created from subclasses
     * of Calendar. Type depends on the object which created them.
     * @access private
     * @var array
     */
    var $children = array();

    /**
     * Constructs the Calendar
     *
     * @param int $y year
     * @param int $m month
     * @param int $d day
     * @param int $h hour
     * @param int $i minute
     * @param int $s second
     *
     * @access protected
     */
    function Calendar($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
    {
        static $cE = null;
        if (!isset($cE)) {
            $cE = & Calendar_Engine_Factory::getEngine();
        }
        $this->cE     = & $cE;
        $this->year   = (int)$y;
        $this->month  = (int)$m;
        $this->day    = (int)$d;
        $this->hour   = (int)$h;
        $this->minute = (int)$i;
        $this->second = (int)$s;
    }

    /**
     * Defines the calendar by a timestamp (Unix or ISO-8601), replacing values
     * passed to the constructor
     *
     * @param int|string $ts Unix or ISO-8601 timestamp
     *
     * @return void
     * @access public
     */
    function setTimestamp($ts)
    {
        $this->year   = $this->cE->stampToYear($ts);
        $this->month  = $this->cE->stampToMonth($ts);
        $this->day    = $this->cE->stampToDay($ts);
        $this->hour   = $this->cE->stampToHour($ts);
        $this->minute = $this->cE->stampToMinute($ts);
        $this->second = $this->cE->stampToSecond($ts);
    }

    /**
     * Returns a timestamp from the current date / time values. Format of
     * timestamp depends on Calendar_Engine implementation being used
     *
     * @return int|string timestamp
     * @access public
     */
    function getTimestamp()
    {
        return $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute, $this->second);
    }

    /**
     * Defines calendar object as selected (e.g. for today)
     *
     * @param boolean $state whether Calendar subclass
     *
     * @return void
     * @access public
     */
    function setSelected($state = true)
    {
        $this->selected = $state;
    }

    /**
     * True if the calendar subclass object is selected (e.g. today)
     *
     * @return boolean
     * @access public
     */
    function isSelected()
    {
        return $this->selected;
    }

    /**
     * Checks if the current Calendar object is today's date
     *
     * @return boolean
     * @access public
     */
    function isToday()
    {
        return $this->cE->isToday($this->getTimeStamp());
    }

    /**
     * Adjusts the date (helper method)
     *
     * @return void
     * @access public
     */
    function adjust()
    {
        $stamp        = $this->getTimeStamp();
        $this->year   = $this->cE->stampToYear($stamp);
        $this->month  = $this->cE->stampToMonth($stamp);
        $this->day    = $this->cE->stampToDay($stamp);
        $this->hour   = $this->cE->stampToHour($stamp);
        $this->minute = $this->cE->stampToMinute($stamp);
        $this->second = $this->cE->stampToSecond($stamp);
    }

    /**
     * Returns the date as an associative array (helper method)
     *
     * @param mixed $stamp timestamp (leave empty for current timestamp)
     *
     * @return array
     * @access public
     */
    function toArray($stamp=null)
    {
        if (is_null($stamp)) {
            $stamp = $this->getTimeStamp();
        }
        return array(
            'year'   => $this->cE->stampToYear($stamp),
            'month'  => $this->cE->stampToMonth($stamp),
            'day'    => $this->cE->stampToDay($stamp),
            'hour'   => $this->cE->stampToHour($stamp),
            'minute' => $this->cE->stampToMinute($stamp),
            'second' => $this->cE->stampToSecond($stamp)
        );
    }

    /**
     * Returns the value as an associative array (helper method)
     *
     * @param string $returnType type of date object that return value represents
     * @param string $format     ['int' | 'array' | 'timestamp' | 'object']
     * @param mixed  $stamp      timestamp (depending on Calendar engine being used)
     * @param int    $default    default value (i.e. give me the answer quick)
     *
     * @return mixed
     * @access private
     */
    function returnValue($returnType, $format, $stamp, $default)
    {
        switch (strtolower($format)) {
        case 'int':
            return $default;
        case 'array':
            return $this->toArray($stamp);
            break;
        case 'object':
            include_once CALENDAR_ROOT.'Factory.php';
            return Calendar_Factory::createByTimestamp($returnType, $stamp);
            break;
        case 'timestamp':
        default:
            return $stamp;
            break;
        }
    }

    /**
     * Abstract method for building the children of a calendar object.
     * Implemented by Calendar subclasses
     *
     * @param array $sDates array containing Calendar objects to select (optional)
     *
     * @return boolean
     * @access public
     * @abstract
     */
    function build($sDates = array())
    {
        include_once 'PEAR.php';
        PEAR::raiseError('Calendar::build is abstract', null, PEAR_ERROR_TRIGGER,
            E_USER_NOTICE, 'Calendar::build()');
        return false;
    }

    /**
     * Abstract method for selected data objects called from build
     *
     * @param array $sDates array of Calendar objects to select
     *
     * @return boolean
     * @access public
     * @abstract
     */
    function setSelection($sDates)
    {
        include_once 'PEAR.php';
        PEAR::raiseError(
            'Calendar::setSelection is abstract', null, PEAR_ERROR_TRIGGER,
            E_USER_NOTICE, 'Calendar::setSelection()');
        return false;
    }

    /**
     * Iterator method for fetching child Calendar subclass objects
     * (e.g. a minute from an hour object). On reaching the end of
     * the collection, returns false and resets the collection for
     * further iteratations.
     *
     * @return mixed either an object subclass of Calendar or false
     * @access public
     */
    function fetch()
    {
        $child = each($this->children);
        if ($child) {
            return $child['value'];
        } else {
            reset($this->children);
            return false;
        }
    }

    /**
     * Fetches all child from the current collection of children
     *
     * @return array
     * @access public
     */
    function fetchAll()
    {
        return $this->children;
    }

    /**
     * Get the number Calendar subclass objects stored in the internal collection
     *
     * @return int
     * @access public
     */
    function size()
    {
        return count($this->children);
    }

    /**
     * Determine whether this date is valid, with the bounds determined by
     * the Calendar_Engine. The call is passed on to Calendar_Validator::isValid
     *
     * @return boolean
     * @access public
     */
    function isValid()
    {
        $validator = & $this->getValidator();
        return $validator->isValid();
    }

    /**
     * Returns an instance of Calendar_Validator
     *
     * @return Calendar_Validator
     * @access public
     */
    function & getValidator()
    {
        if (!isset($this->validator)) {
            include_once CALENDAR_ROOT.'Validator.php';
            $this->validator = new Calendar_Validator($this);
        }
        return $this->validator;
    }

    /**
     * Returns a reference to the current Calendar_Engine being used. Useful
     * for Calendar_Table_Helper and Calendar_Validator
     *
     * @return object implementing Calendar_Engine_Inteface
     * @access protected
     */
    function & getEngine()
    {
        return $this->cE;
    }

    /**
     * Set the CALENDAR_FIRST_DAY_OF_WEEK constant to the $firstDay value
     * if the constant is not set yet.
     *
     * @param integer $firstDay first day of the week (0=sunday, 1=monday, ...)
     *
     * @return integer
     * @throws E_USER_WARNING this method throws a WARNING if the
     *    CALENDAR_FIRST_DAY_OF_WEEK constant is already defined and
     *    the $firstDay parameter is set to a different value
     * @access protected
     */
    function defineFirstDayOfWeek($firstDay = null)
    {
        if (defined('CALENDAR_FIRST_DAY_OF_WEEK')) {
            if (!is_null($firstDay) && ($firstDay != CALENDAR_FIRST_DAY_OF_WEEK)) {
                $msg = 'CALENDAR_FIRST_DAY_OF_WEEK constant already defined.'
                  .' The $firstDay parameter will be ignored.';
                trigger_error($msg, E_USER_WARNING);
            }
            return CALENDAR_FIRST_DAY_OF_WEEK;
        }
        if (is_null($firstDay)) {
            $firstDay = $this->cE->getFirstDayOfWeek(
                $this->thisYear(),
                $this->thisMonth(),
                $this->thisDay()
            );
        }
        define ('CALENDAR_FIRST_DAY_OF_WEEK', $firstDay);
        return CALENDAR_FIRST_DAY_OF_WEEK;
    }

    /**
     * Returns the value for the previous year
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 2002 or timestamp
     * @access public
     */
    function prevYear($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year-1, 1, 1, 0, 0, 0);
        return $this->returnValue('Year', $format, $ts, $this->year-1);
    }

    /**
     * Returns the value for this year
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 2003 or timestamp
     * @access public
     */
    function thisYear($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year, 1, 1, 0, 0, 0);
        return $this->returnValue('Year', $format, $ts, $this->year);
    }

    /**
     * Returns the value for next year
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 2004 or timestamp
     * @access public
     */
    function nextYear($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year+1, 1, 1, 0, 0, 0);
        return $this->returnValue('Year', $format, $ts, $this->year+1);
    }

    /**
     * Returns the value for the previous month
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 4 or Unix timestamp
     * @access public
     */
    function prevMonth($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year, $this->month-1, 1, 0, 0, 0);
        return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
    }

    /**
     * Returns the value for this month
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 5 or timestamp
     * @access public
     */
    function thisMonth($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year, $this->month, 1, 0, 0, 0);
        return $this->returnValue('Month', $format, $ts, $this->month);
    }

    /**
     * Returns the value for next month
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 6 or timestamp
     * @access public
     */
    function nextMonth($format = 'int')
    {
        $ts = $this->cE->dateToStamp($this->year, $this->month+1, 1, 0, 0, 0);
        return $this->returnValue('Month', $format, $ts, $this->cE->stampToMonth($ts));
    }

    /**
     * Returns the value for the previous day
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 10 or timestamp
     * @access public
     */
    function prevDay($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day-1, 0, 0, 0);
        return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
    }

    /**
     * Returns the value for this day
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 11 or timestamp
     * @access public
     */
    function thisDay($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day, 0, 0, 0);
        return $this->returnValue('Day', $format, $ts, $this->day);
    }

    /**
     * Returns the value for the next day
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 12 or timestamp
     * @access public
     */
    function nextDay($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day+1, 0, 0, 0);
        return $this->returnValue('Day', $format, $ts, $this->cE->stampToDay($ts));
    }

    /**
     * Returns the value for the previous hour
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 13 or timestamp
     * @access public
     */
    function prevHour($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day, $this->hour-1, 0, 0);
        return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
    }

    /**
     * Returns the value for this hour
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 14 or timestamp
     * @access public
     */
    function thisHour($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day, $this->hour, 0, 0);
        return $this->returnValue('Hour', $format, $ts, $this->hour);
    }

    /**
     * Returns the value for the next hour
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 14 or timestamp
     * @access public
     */
    function nextHour($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day, $this->hour+1, 0, 0);
        return $this->returnValue('Hour', $format, $ts, $this->cE->stampToHour($ts));
    }

    /**
     * Returns the value for the previous minute
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 23 or timestamp
     * @access public
     */
    function prevMinute($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute-1, 0);
        return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
    }

    /**
     * Returns the value for this minute
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 24 or timestamp
     * @access public
     */
    function thisMinute($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute, 0);
        return $this->returnValue('Minute', $format, $ts, $this->minute);
    }

    /**
    * Returns the value for the next minute
    *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 25 or timestamp
     * @access public
     */
    function nextMinute($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute+1, 0);
        return $this->returnValue('Minute', $format, $ts, $this->cE->stampToMinute($ts));
    }

    /**
     * Returns the value for the previous second
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 43 or timestamp
     * @access public
     */
    function prevSecond($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute, $this->second-1);
        return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
    }

    /**
     * Returns the value for this second
     *
    * @param string $format return value format ['int'|'timestamp'|'object'|'array']
    *
     * @return int e.g. 44 or timestamp
     * @access public
     */
    function thisSecond($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute, $this->second);
        return $this->returnValue('Second', $format, $ts, $this->second);
    }

    /**
     * Returns the value for the next second
     *
     * @param string $format return value format ['int'|'timestamp'|'object'|'array']
     *
     * @return int e.g. 45 or timestamp
     * @access public
     */
    function nextSecond($format = 'int')
    {
        $ts = $this->cE->dateToStamp(
            $this->year, $this->month, $this->day,
            $this->hour, $this->minute, $this->second+1);
        return $this->returnValue('Second', $format, $ts, $this->cE->stampToSecond($ts));
    }
}
?>