1

Can't really find information on this and nothing I've tried is working.

Before I had it as,

$args = array(
    . . . . . . . .
        'date_query' => array(
            'after'  => '-4 hour',
            'inclusive' => true
        )
);

Worked fine. But now I'm trying to make it after -3 hour and -30 minute..

How do I do this?

'date_query' => array(
    'after'    => array(
        'hour'  => '-3',
        'minute' => '-30'
    ),
    'inclusive' => true

doesn't work

    'date_query' => array(
        // 'after'  => '-4 hour',
        'after'    => array(
            '-4 hour', 
            '-30 minute'
        ),
        'inclusive' => true
    )

doesn't work..

I'm sure it's something simple. Anyone know the solution?

2

Here's one way translating it to minutes only:

$args = [ 
    'date_query' => [
        'after'     => '270 minutes ago', // <-- 4 hours and 30 minutes ago
        'inclusive' => true
    ] 
];
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.