Location: PHPKode > scripts > Script Box > script-box/PHP4/SB/examples/dateAndTime/dateAndTime.example.php
<?php

/**
 * dateAndTime produces the date in various formats
 *
 * @author Michael J. Burgess
 * @package Example.dateAndTime
 * @version 1.5
 * @copyright GNU Public Licence, Versions 2 and above
 * @see root/docs/manual.html
 * 
 */


include('../../ScriptBox.class.php'); //include the class file


$sb = new ScriptBox('../../common/'); //set the path two levels up (not required for date and time!)



$sb->dateAndTime('date'); echo '<br />'; //Produces full date (e.g. Sunday 1st of January 2006)

$sb->dateAndTime('time'); echo '<br />'; //Time, hours : minutes : seconds AM/PM (e.g. 09:10:50 AM)

$sb->dateAndTime('both'); echo '<br />'; //Both date and time (e.g. Sunday 1st of January 2006. 09:10:50 AM)

$sb->dateAndTime('shortUK'); echo '<br />'; //Short date, in UK format, e.g. 31/12/06.

$sb->dateAndTime('shortUS'); echo '<br />'; //Short date, in US format, e.g. 12/31/06.

$sb->dateAndTime('shortDB'); echo '<br />'; //Short date, in (MySQL) DataBase format, e.g. 2006/12/31



?>
Return current item: Script Box