Tag

time

Browsing
php-logo

Voici le message d’erreur PHP qui est apparu récemment dans mes logs Apache :

PHP Warning: strtotime(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone.

Ajout de la directive date.timezone dans php.ini

On commence par trouver le fichier php.ini qui est actuellement utilisé par le serveur. Il en existe plusieurs, suivant les modules activés donc on commence par repérer le bon avec :

php -i | grep 'Configuration File'

Résultat :

Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0

Effectivement, l’erreur est répétée même dans un simple phpinfo(). On édite donc notre fichier :

nano /etc/php5/cli/php.ini

La page de manuel des timezones nous indique toute la liste des fuseaux horaires disponibles. Nous choisissons celle qui correspond à l’emplacement de notre serveur : ‘Europe/Paris’.

On recherche la bonne directive avec Ctrl + W et en tapant :

date.

On trouve alors :

[Date]
; Defines the default timezone used by the date functions
; http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
;date.timezone =

qu’il faut modifier en :

[Date]
; Defines the default timezone used by the date functions
; http://php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = 'Europe/Paris'

On relance Apache pour prendre en compte la nouvelle configuration :

service apache2 restart

Flash Forward est une série diffusée sur la chaîne ABC.

flashforward saison 1

Agent du FBI à Los Angeles, Mark Benford (Joseph Fiennes) se réveille dans un véhicule accidenté, entouré de chalands affolés et des conséquences d’un nombre hallucinant d’accidents divers.

Interdit, il assiste impuissant à une scène où se côtoient les plus simples carambolages et crashs aériens d’envergure.

La raison de ce tableau digne des visions apocalyptiques les plus folles ? L’intégralité des habitants de la planète a perdu conscience pendant deux minutes et dix-sept secondes.

Midnight Hour...Watch your watches people ! The last day of 2005 will be one second longer than usual. The precision of atomic clocks will be reconciled with the relative variability of the Earth’s rotation on Dec. 31, when an extra second will be added to the Coordinated Universal Time used to tell time across the globe.

The Earth’s rotational speed changes slightly because of tides and other forces, and the National Institute of Standards and Technology recalibrates its clocks occasionally to match them to the planet’s time, called the astronomical time scale. The adjustment, called a leap second, takes place whenever Coordinated Universal Time is out of synch with the planet’s time by more than 0.9 seconds. On Dec. 31, Coordinated Universal Time will change from 23:59:59 to 23:59:60 before moving to 0:00:00 on January 1. The last time a leap second was added was 1998, but usually they’re added slightly less than once each year, NIST said. The first leap second was added in 1972, and often the extra second has been added at the end of June instead of the end of December. [From Cnet]. Learn more about the leap second.

That would make an awesome movie if shot correctly with a plotline and good actors. Ooops, that excludes an Hollywood shooting then !

Spelling error report

The following text will be sent to our editors: