How to use PHP glob() with minimum file date (filemtime)?

I want to get a range of files with PHP glob function, but no older than a month (or other specified date range). My current code: $datetime_min = new DateTime(‘today – 4 weeks’); $product_files = …

If statement returning false result using date and strtotime

I’m trying to use an if statement to say “If today is between two dates, do this…” etc. It’s not working, and I’m at a total loss because as far as I can see – it SHOULD work! if (date(‘d/…

PHP how to calculate days between 2 array session dates?

I’m sorry for the terribly long question. I just want to make sure that this problem is fully addressed: so through an html form, I asked user to give four information five times: deliveryby, itemNo, …

Get on sale dates for the variations of a WooCommerce variable product

Is there any way to get on_sale_from and on_sale_to dates for WooCommerce variable products in an array using PHP? The highlighted red boxes in this screenshot:

(php) change a duration to something useable by my calendar

I have a series of event dates (variable durations) in the following formats: 28 April 2020 3 – 5 May 2020 3 May – 5 June 2020 20 Dec 2020 – 15 Jan 2021 I want to keep these this way, for …

How to display days and hours with date() in php

I have a timestamp which calculates remaining time between 2 dates. $job_expiration = strtotime($job[‘job_expiration’]) – time(); like so. Right now, I’m showing only 1 day or 2 days with the date()…

how to add if current date is before a certain date condition as an if-statement parameter

I have a WordPress site and I have written a filter: function wc_add_string_to_price_newline( $price, $product ) { $product_id = $product->get_id(); if ($product_id == ‘1190’) { $…

Split weeks of month

I’m trying to get a week range for the month, I’ve somewhat accomplished what I’m looking for but I’d like the code to be more reliable. The data ranges are going to be used to some MySQL queries …

PHP calculate past dates from today

I have created a PHP function that calculates how old a WordPress/WooCommerce order is. If the order is older than 90 days it should be canceled. The function used to work perfectly. However, since …

Laravel Eloquent – Specific Date Filtering

I have a Laravel app that sends reminders on specific days prior to a tenancy_start_date. Essentially every 3 days, then 2 days, then daily ([30, 27, 24, 21, 19, 17, 15, 13, 11, 9, 8, 7, 6, 5]) Is …