spinPHP

Displaying current date and time

Below are examples on how to use PHP to display the current date and time on the server.

PHP code:

Result:

<? echo(date("m/d/y")); ?>

<? echo(date("m/d/Y")); ?>

<? echo(date("M/d/Y")); ?>

<? echo(date("h.i M/d/Y")); ?>

  
<? echo(date("d/m/y"); ?>

<? echo(date("d/m/Y"); ?>

<? echo(date("d/M/Y"); ?>

  
<? echo(date("d.m.y")); ?>

<? echo(date("d.m.Y")); ?>

<? echo(date("d.M.Y")); ?>

  
<? echo(date("y-m-d")); ?>

<? echo(date("Y-m-d")); ?>

<? echo(date("Y-M-d")); ?>

  
<? echo(date("h.i")); ?>

<? echo(date("h.i.s")); ?>

<? echo(date("H:i")); ?>

<? echo(date("H:i:s")); ?>

This PHP code example is copyright © 2002-2003 Optima System. All rights reserved worldwide. Unauthorized distribution prohibited. SpinPHP™ User License.