#93. PHP Strtotime, Strftime, Gmstrftime Function

 How to work PHP Strtotime, Strftime, Gmstrftime Function?

Syntax:




Run Code:

<?php

echo date("d-m-Y", strtotime("now")). "<br>";
echo date("d-m-Y", strtotime("3 jan 2003")). "<br>";
echo date("d-m-Y H:m", strtotime("+3 hours")). "<br>";
echo date("d-m-Y H:m", strtotime("+1 week")). "<br>";
echo date("d-m-Y H:m", strtotime("+1 week 3 days 7 hours 5 seconds")). "<br>";
echo date("d-m-Y H:m", strtotime("next Monday")). "<br>";
echo date("d-m-Y H:m", strtotime("last Monday")). "<br>";
echo date("d-m-Y H:m", strtotime("first day of last Month")). "<br>";


echo strftime("%B %d %Y, %X %Z"). "<br>";
echo strftime("%B %d %Y, %X %Z", mktime(23,22,0,05,12,2002)). "<br>";
echo strftime("%d/%m/%Y, %H:%M:%S"). "<br>";
echo gmstrftime("%B %d %Y, %X %Z"). "<br>";

?>

Comments

Popular posts from this blog

#30. PHP Recursive Function