Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZTime Class Reference

## Public Member Functions
| __construct ( $hour=-1, $minute=-1, $second=-1)
| hour ()
| minute ()
| second ()
| secondsElapsed ()
| setHour ( $value)
| setMinute ( $value)
| setSecond ( $value)
| setSecondsElapsed ( $value)
| setSecondsElapsedHMS ( $hour, $minute, $second)
| add ( $time)
| subtract ( $time)
| isGreater (&$time, $equal=false)
| equals (&$time)
| setMySQLTime ( $value)
| mysqlTime ()
| setTimeStamp ( $value)

## Static Public Member Functions
| timeStamp ( $returnNow=false)

## Public Attributes
| $SecondsElapsed
| Store the number of seconds since 00:00:00. More...
| $Time

## Private Member Functions
| addZero ( $value)

## Detailed Description

! eZCommon The eZTime class provides time functions.

eZTime handles 24 hour time format.

See also
  eZLocale eZTimeDate eZDate

Definition at line 37 of file eztime.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTime::__construct | ( |  | $hour = `-1`,
|  |  | $minute = `-1`,
|  |  | $second = `-1`
| ) |  |

Constructs a new eZTime object.

Definition at line 42 of file eztime.php.

References $hour, $minute, and setSecondsElapsedHMS().

## Member Function Documentation

## ◆ add()

eZTime::add | ( |  | $time | ) |

Adds the value of the given eZTime object to the internal time, and returns the result. Does not change the internal time.

Returns false if the requested object was not an eZTime object.

Definition at line 160 of file eztime.php.

References $ret, $time, $tmpTime, hour(), minute(), second(), and secondsElapsed().

## ◆ addZero()

eZTime::addZero | ( |  | $value | ) |
| private

Adds a "0" infront of the value if it's below 10.

Definition at line 187 of file eztime.php.

References $ret.

Referenced by mysqlTime().

## ◆ equals()

eZTime::equals | ( | & | $time | ) |

Returns true if the eZTime object given as argument is equals to the internal values.

Returns false is the object is not a eZTime object.

Definition at line 261 of file eztime.php.

References $ret, and $time.

## ◆ hour()

eZTime::hour | ( |  | ) |

Returns the hour value in 24 hour format.

Definition at line 59 of file eztime.php.

References $hour, $minute, and $SecondsElapsed.

Referenced by add(), mysqlTime(), setMinute(), setSecond(), subtract(), and timeStamp().

## ◆ isGreater()

eZTime::isGreater | ( | & | $time,
|  |  | $equal = `false`
| ) |  |

Returns true if the eZTime object given as argument is greater than the internal values.

If $equal is set to true then true is returned if the time is greater than or equal.

Returns false is the object is not a eZTime object.

Definition at line 231 of file eztime.php.

References $ret, and $time.

## ◆ minute()

eZTime::minute | ( |  | ) |

Returns the minute value in 0..59.

Definition at line 77 of file eztime.php.

References $minute, and $SecondsElapsed.

Referenced by add(), mysqlTime(), setHour(), setSecond(), subtract(), and timeStamp().

## ◆ mysqlTime()

eZTime::mysqlTime | ( |  | ) |

Returns the MySQL times equivalent to the time stored in the object.

Definition at line 296 of file eztime.php.

References $hour, $minute, addZero(), hour(), minute(), and second().

## ◆ second()

eZTime::second | ( |  | ) |

Return the second value in 0..59.

Definition at line 92 of file eztime.php.

References $SecondsElapsed.

Referenced by add(), mysqlTime(), setHour(), setMinute(), subtract(), and timeStamp().

## ◆ secondsElapsed()

eZTime::secondsElapsed | ( |  | ) |

Returns the number of seconds elapsed since midnight.

Definition at line 104 of file eztime.php.

References $SecondsElapsed.

Referenced by add().

## ◆ setHour()

eZTime::setHour | ( |  | $value | ) |

Sets the hour value.

Definition at line 112 of file eztime.php.

References minute(), and second().

Referenced by setTimeStamp().

## ◆ setMinute()

eZTime::setMinute | ( |  | $value | ) |

Sets the minute value.

Definition at line 122 of file eztime.php.

References hour(), and second().

Referenced by setTimeStamp().

## ◆ setMySQLTime()

eZTime::setMySQLTime | ( |  | $value | ) |

Sets the time according to the MySQL time given as a parameter. If the value is invalid an error message is printed and no values are set.

Definition at line 280 of file eztime.php.

References setSecondsElapsedHMS().

## ◆ setSecond()

eZTime::setSecond | ( |  | $value | ) |

Sets the second value.

Definition at line 131 of file eztime.php.

References hour(), and minute().

Referenced by setTimeStamp().

## ◆ setSecondsElapsed()

eZTime::setSecondsElapsed | ( |  | $value | ) |

Sets the number of seconds elapsed since midnight.

Definition at line 140 of file eztime.php.

## ◆ setSecondsElapsedHMS()

eZTime::setSecondsElapsedHMS | ( |  | $hour,
|  |  | $minute,
|  |  | $second
| ) |  |

Sets the number of seconds elapsed since midnight.

Definition at line 148 of file eztime.php.

References $hour, and $minute.

Referenced by __construct(), and setMySQLTime().

## ◆ setTimeStamp()

eZTime::setTimeStamp | ( |  | $value | ) |

Sets the time according to the UNIX timestamp given as argument.

Definition at line 308 of file eztime.php.

References setHour(), setMinute(), and setSecond().

## ◆ subtract()

eZTime::subtract | ( |  | $time | ) |

Subtracts the value of the given eZTime object from the internal time, and returns the result. Does not change the internal time.

Returns false if the requested object was not an eZTime object. If the given time is greater than the internal time, the subtraction will wrap around midnight.

Definition at line 206 of file eztime.php.

References $ret, $SecondsElapsed, $time, $tmpTime, hour(), minute(), and second().

## ◆ timeStamp()

eZTime::timeStamp | ( |  | $returnNow = `false` | ) |
| static

Returns the time as a UNIX timestamp.

If returnNow is set to true a timestamp of the current time is returned.

Definition at line 331 of file eztime.php.

References hour(), minute(), and second().

## Member Data Documentation

## ◆ $SecondsElapsed

eZTime::$SecondsElapsed

Store the number of seconds since 00:00:00.

Definition at line 340 of file eztime.php.

Referenced by hour(), minute(), second(), secondsElapsed(), and subtract().

## ◆ $Time

eZTime::$Time

Definition at line 341 of file eztime.php.

The documentation for this class was generated from the following file:

- eztime.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.