openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6117066c4dff537274081d4d94ceea13f10f07f7
parent b6b7501ba210c95069ab46d2f160cd64a2e52f73
Author: dankert <devnull@localhost>
Date:   Sun, 18 Oct 2009 23:36:30 +0200

Neue Methode \"now()\", die die Systemzeit abhängig von der Konfiguration ermittelt.

Diffstat:
functions/common.inc.php | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/functions/common.inc.php b/functions/common.inc.php @@ -20,4 +20,22 @@ function convertToXmlAttribute( $value ) return utf8_encode( htmlspecialchars( $value ) ) ; } + +/** + * Ermittelt die aktuelle Systemzeit als Unix-Timestamp.<br> + * Es wird konfigurationsgesteuert entweder die lokale Zeit oder + * die GMT-Zeit (UTC) zurückgegeben.<br> + * Konfigurationsschalter ist 'date/database/utc'. + * - + * @return Unix-Timestamp der aktuellen Zeit + */ +function now() +{ + global $conf; + + if ( @$conf['date']['database']['utc'] ) + return gmdate('U'); + else + return time(); +} ?> \ No newline at end of file