Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter iebsoftware

    (@iebsoftware)

    Thanks for all the help. I’m still not sure why it is happening but it may be as you suggests a server setting or another plugin bug. An easy fix is to just add a further few hours onto the 24:

    $hours_to_add = $day_count*24 + 5;
    $this_timestamp = mktime($hours_to_add,0,0,date("m",$current_timestamp),date("d",$current_timestamp),date("Y",$current_timestamp));

    As the plugin isn’t showing times this is working fine for me.

    Thread Starter iebsoftware

    (@iebsoftware)

    Everything looks fine with the current time. On the iteration of the loop for 23nd March:

    CurrentTimeStamp is 1615910560: Tuesday, March 16th 2021, 16:02:40 (GMT)
    Day_Count is 7
    Timestamp is 1616454000: Monday, March 22nd 2021, 23:00:00 (GMT)

    This means the displayed date on the event widget is 22nd March, not 23rd.

    I don’t think our Daylight Savings/ British summertime (BST) would affect it, that doesn’t kick in until March 28th.

    Thread Starter iebsoftware

    (@iebsoftware)

    Thanks, you are correct, I made an assumption and it turns out the dates are stored correctly in the DB.

    I have looked at the code, and it seems to be a line in this file:
    wp-content/plugins/spiffy-calendar/includes/views.php (line 1947)

    $this_timestamp = mktime($day_count*24,0,0,date("m",$current_timestamp),date("d",$current_timestamp),date("Y",$current_timestamp));

    The $this_timestamp variable is always coming out at 23:00 hours on the day before you would expect, as if it is adding only 23 hours and not 24. If I change the 24 to 25 it works as expected. I’m not a PHP expert and this has me stumped. Any ideas?

    Thread Starter iebsoftware

    (@iebsoftware)

    We have the time zone set as London and the date format as 16/03/2021. Start date and End date for event are currently set as 2021-03-23, times are blank. The front end is showing 22/03/2021.

    I had a quick look and grabbed the stored timestamp from the database. The value stored is 1616454000 which translates to Monday, March 22nd 2021, 23:00:00 (GMT)

    See conversion here

Viewing 4 replies - 1 through 4 (of 4 total)