90 lines
1.5 KiB
PHP
Executable File
90 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
/**------------------------------------------------
|
|
*
|
|
* Rooty, 2018 <rooty@rooty.me>
|
|
*
|
|
*
|
|
* This software is protected by copyright, please
|
|
* read the file COPYRIGHT.
|
|
* This program is distributed in the hope that it
|
|
* will be useful, but without any warranty; without
|
|
* even the implied warranty of merchantability or
|
|
* fitness for a particular purpose. Please
|
|
* read the file LICENCE.
|
|
*
|
|
*Fichier NDATE.php
|
|
*
|
|
*Ce fichier contient la classe date
|
|
*
|
|
* @author Rooty <www.rooty.me|rooty@rooty.me>
|
|
* @link www.rooty.me
|
|
* @since 2018/04/09
|
|
* @version 0.3
|
|
* @copyright Copyright © 2009-2018, Rooty
|
|
* @package system_utils
|
|
*/
|
|
|
|
/**
|
|
* Classe Chaine
|
|
*
|
|
* classe permettant de Normaliser une chaine
|
|
*
|
|
* @desc Classe permettant de normaliser une chaine
|
|
* @package system_utils
|
|
*/
|
|
class NDate
|
|
{
|
|
/**#@+
|
|
* @access public
|
|
*/
|
|
|
|
/** @var string
|
|
* @desc Source de donnée de la date (time)
|
|
*/
|
|
var $src = null;
|
|
|
|
/**#@-*/
|
|
|
|
//
|
|
// Constructor
|
|
//
|
|
/**
|
|
*Constructeur de la classe NDate
|
|
*
|
|
*<p>Initialise la donnée</p>
|
|
*
|
|
* @param chaine src source de donnée
|
|
*/
|
|
function __construct($src, $type)
|
|
{
|
|
if ($type==0)
|
|
$this->src=strgbtomktime($src); // Pour la date en mktime à partir d'un GB
|
|
else
|
|
$this->src=strfrtomktime($src); // Pour la date en mktime à partir d'un FR
|
|
}
|
|
|
|
/**
|
|
* Fr()
|
|
*
|
|
*<p>Retourne la date au format Fr</p>
|
|
*
|
|
*/
|
|
function Fr()
|
|
{
|
|
return dategbtofr(date("Y-m-d",$this->src));
|
|
}
|
|
|
|
/**
|
|
* Gb()
|
|
*
|
|
*<p>Retourne la date au format Gb</p>
|
|
*
|
|
*/
|
|
function Gb()
|
|
{
|
|
return date("Y-m-d",$this->src);
|
|
}
|
|
}
|
|
?>
|