A
A
Aramano2021-05-03 17:43:13
PHP
Aramano, 2021-05-03 17:43:13

How to subtract 30 days from the current date?

$QIWI_history = $qiwi->getPaymentsHistory([
        'operation' => 'OUT',
        'startDate' => '2018-03-01T00:00:00+03:00',
        'endDate' => '2018-03-01T00:00:00+03:00',
        'rows' => '50'
      ]);

The bottom line is that on endDate I need to get the current date, and on startDate I need to get -30 days from the current date. I often have problems with dates in my work.. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
N, 2021-05-03
@Aramano

1. Working with date and time in Laravel and PHP using...
2. Carbon. Documentation.

I often have problems with dates at work..

Now there shouldn't be any problems...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question