RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.38% (6.14%*) • Home Loan Fixed: 5.44% (6.26%*) • Fixed: 5.44% (6.26%*) • Variable: 5.38% (6.14%*) • Investment IO: 5.69% (6.52%*) • Investment PI: 5.49% (5.98%*)

Determine The First Monday Timestamp After a Weekend

After a comment from a user on a post we shared detailing new Instagratify features, we wrote up this quick function to see how his suggestion might be applied. When scheduling from Instagram, he didn't want to share posts on a weekend - instead posting on the next Monday at a certain time.

The function below will assess a timestamp to determine if it falls on a Saturday or Sunday and, if it does, determine the timestamp of the following Monday (at a certain time).

1
<?php 
2
/*
3
 Determine The First Monday Timestamp After a Weekend
4
 http://www.beliefmedia.com/code/php-snippets/first-monday-timestamp
5
*/
6
 
7
function beliefmedia_next_monday($timestamp, $time = '10am') {
8
 
9
  $day = date('N', $timestamp);
10
  $timestamp = ($day == 6 || $day == 7) ? strtotime("next monday $time", $timestamp) : $timestamp;
11
 
12
 return $timestamp;
13
}

Usage is as follows:

1
<?php 
2
$timestamp = '1511010605';
3
echo beliefmedia_next_monday($timestamp, $time = '10am');

■ ■ ■

 
Download our complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment