PHP strftime() Function

What is a strftime Function?

Explanation

The "strftime()" function is used to format a locale time/date according to local settings.

Syntax:


strftime(format,timestamp)

In the above syntax the parameters for timestamp specifies the format of the output. The time stamp is an optional value, which specifies the date or time to be formatted.

Example :


<?php
echo(strftime("%b %d %Y %X", mktime(20,0,0,12,31,98))."<br />");
?>
Result :

Dec 31 1998 20:00:00

In the above example the strftime() function specifies the format starting with month, date, year and current time.

Note :

(PHP 4, PHP 5)

PHP Topics


Ask Questions

Ask Question