Which expert can obtain the date method of the previous day of the specified date? thank you! Which of the following methods can be used to obtain the date of the specified date, instead of date (& quot; Y-m-d & quot;, strtotime (& quot; -5day & quot;), where "Y-m-d" is to be acquired by a daily master. Which of the following methods can you tell me how to obtain the date from the previous day of the specified date? thank you!
Which of the following methods can be used to obtain the date of a specified date, instead of date ("Y-m-d", strtotime ("-5 day ")), the "Y-m-d" must be replaced by a date value variable. Thank you !!!
------ Solution --------------------
Do you mean that the star format is Y-m-d H: I: s, so you won't use date ("Y-m-d ", strtotime ("-5 day"). if so, format the preceding format using the time function. Use this function. I don't quite understand what the landlord means
------ Solution --------------------
Date ("Y-m-d", strtotime ("-5 day "))
The first five days of today.
So
$ D = '2017-10-2 ';
Echo date ("Y-m-d", strtotime ("-5 day $ d "));
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.