note 119623 deleted from function.strtotime by cmb
| From: | cmb@php.net | Date: | Tue, 19 Jul 2016 18:12:52 +0000 |
| Subject: | note 119623 deleted from function.strtotime by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206054@lists.php.net to get a copy of this message | ||
Note Submitter: jefrey no spam please at jefrey dot ml
----
strtotime is really very powerful and smarty. It's good to play around with it and test it to
see what it can do. You'll be surprised.
Here are some examples, using altogether with Twig and Date Range Picker for Bootstrap:
"ranges": {
"Today": [
"{{ strtotime('today midnight')|date('Y-m-d\TH:i:s')
}}",
"{{ time()|date('Y-m-d\TH:i:s') }}"
],
"Yesterday": [
"{{ strtotime('yesterday
midnight')|date('Y-m-d\TH:i:s') }}",
"{{ strtotime('yesterday
23:59:59')|date('Y-m-d\TH:i:s') }}",
],
"Last 7 days": [
"{{ strtotime('midnight 7 days
ago')|date('Y-m-d\TH:i:s') }}",
"{{ time()|date('Y-m-d\TH:i:s') }}"
],
"Last 30 days": [
"{{ strtotime('midnight 30 days
ago')|date('Y-m-d\TH:i:s') }}",
"{{ time()|date('Y-m-d\TH:i:s') }}"
],
"This month": [
"{{ strtotime('midnight first day of this
month')|date('Y-m-d\TH:i:s') }}",
"{{ time()|date('Y-m-d\TH:i:s') }}"
],
"Last month": [
"{{ strtotime('midnight first day of last
month')|date('Y-m-d\TH:i:s') }}",
"{{ strtotime('last day of last month
23:59:59')|date('Y-m-d\TH:i:s') }}"
]