PHP strptime() function

PHP strftime() function
PHP strtotime() function

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

strptime(date, format)
ParameterDescription
dateRequired. The string to parse (e.g. returned from strftime())
formatRequired. Specifies the format used in the date:

Examples of the strptime() function

Example 1. In this example,

<?php
$format="%d/%m/%Y %H:%M:%S";
$strf=strftime($format);
echo("$strf");
print_r(strptime($strf,$format));
?>
PHP strftime() function
PHP strtotime() function

Stay up-to-date about PHP!

We don’t spam!

en English
X
Scroll to Top