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 = …

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 …

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 …

Issue with getting the day of a month with the week day and year

I’m trying to get the day of a month with this code: // your input $month = “September”; $year = “2013”; $dayWeek = “Friday”; $week = 2; // create a date object $date = new …

Search Array for Best Match based on Day & Time

I’m trying to work out how to the the correct Site base on the current Day and Time from an array. The examples array just shows Monday, the real array will contain 7 days of the week with multiple …