PHP strftime() function

PHP mktime() function
PHP strptime() function

What is the syntax of the strftime() function in PHP?

strftime(format, timestamp)
ParameterDescription
formatRequired. Specifies how to return the result:
timestamp
Optional. Specifies a Unix timestamp that represents the date and/or time to be formatted. Default is the current local time (time())

Examples of the strftime() function

Example 1. In this example,

<?php
echo(strftime("%B %d %Y, %X %Z",mktime(20,0,0,12,31,98))."<br>");
setlocale(LC_ALL,"hu_HU.UTF8");
echo(strftime("%Y. %B %d. %A. %X %Z"));
?>
PHP mktime() function
PHP strptime() function
en English
X
Scroll to Top