PHP strtotime function unix timestamp _php tutorial

Source: Internet
Author: User
If the format of time is absolute, then the now parameter does not work. If the format of time is relative, its relative time is provided by now, or if it is not supplied with the current time. Returns-1 on failure.

Echo Strtotime ("Now"), "\ n";
Echo Strtotime ("Ten September"), "\ n";
Echo strtotime ("+1 Day"), "\ n";
Echo strtotime ("+1 Week"), "\ n";
Echo strtotime ("+1 Week 2 days 4 hours 2 Seconds"), "\ n";
Echo Strtotime ("next Thursday"), "\ n";
Echo Strtotime ("Last Monday"), "\ n";
?> $str = ' not good ';
if ($timestamp = Strtotime ($str)) = = = 1) {
echo "The string ($STR) is bogus";
} else {
echo "$str = =". Date (' L DS of F Y h:i:s A ', $timestamp);
}
?>
This effect is the same as with Mktime ().

http://www.bkjia.com/PHPjc/319828.html www.bkjia.com true http://www.bkjia.com/PHPjc/319828.html techarticle if the format of time is absolute, then the now parameter does not work. If the format of time is relative, its relative time is provided by now, or if the now parameter is not provided when ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.