PHP strptime() function

P
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

Add comment

Tutor Network

Share this

Learn PHP from A to Z