Title: Wrong Date (Day -1)
Last modified: November 23, 2019

---

# Wrong Date (Day -1)

 *  [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/)
 * Hey there,
    recently I have an error in displaying the date. All days are correct
   in my database, but wrong while created for any display (front-/backend).
 * As a quick workaround I replaced line 227 and 237
    $mfgigcal_date .= “<div class
   =\”day\”>” . date_i18n(“d”, $start_date) . “</div>”;
 * with
    $mfgigcal_date .= “<div class=\”day\”>” . $startArray[2] . “</div>”;
 * Same in line 244 but there with $endArray
    $mfgigcal_date .= “<div class=\”day\”
   >” . $endArray[2] . “</div>”;
 * As a quick workaround that works for me, however, it would be great if someone
   has an idea what’s wrong/not working on that spot.
 * Cheers
    Clemens

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/wrong-date-day-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wrong-date-day-1/page/2/?output_format=md)

 *  Plugin Author [Matthew Fries](https://wordpress.org/support/users/brewermfnyc/)
 * (@brewermfnyc)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12169777)
 * Clemens
 * This helps a lot. I’ve had 2 people tell me they are having this issue. I’ve 
   been unable to replicate it here and this the first info I’ve gotten confirming
   that the data in the DB isn’t distorted – that it’s an issue with date_i18n()
   returning the wrong day. Looking into it!
 * Did you happen to notice, is it just the day (number) that is incorrect? Or is
   it actually shifting it by a day?
 * For example: Nov 30 becomes Dec 1 on output.
 * Also – are you seeing this in the admin area AND on your site? Or is it correct
   in admin area?
 * Thanks for the help.
    -  This reply was modified 6 years, 6 months ago by [Matthew Fries](https://wordpress.org/support/users/brewermfnyc/).
 *  Thread Starter [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12169823)
 * Hey Matthew,
 * it pretty much looks like the day is always -1 – so 01.01.2020 turns 31.12.2019
 * > Also – are you seeing this in the admin area AND on your site? Or is it correct
   > in admin area?
 * I can confirm that it is wrong in the table/listing of all dates, but it is correct
   if I go and edit one special event with its details.
 * If you need further information just let me know!
 *  Plugin Author [Matthew Fries](https://wordpress.org/support/users/brewermfnyc/)
 * (@brewermfnyc)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12169885)
 * Thanks for the help. I know that WP date function is reported to be kinda finicky,
   so I’m looking for answers. I might send you a patch to try out (since I can’t
   replicate the problem here) if you’re game. Would be nice to know an update does
   what I hope before I release it!
 *  Thread Starter [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12181304)
 * Thanks, I just tried out the update, but it’s breaking down my WordPress with
   an critical error…
 *  Plugin Author [Matthew Fries](https://wordpress.org/support/users/brewermfnyc/)
 * (@brewermfnyc)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12181441)
 * Eeek!! Can you tell me what the error says? I did test it on 5 or 6 different
   sites I run before posting here and didn’t have any issues.
 *  Thread Starter [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12181565)
 * Fatal error: Cannot redeclare date_format_php_to_js() (previously declared in/…/
   101_live/wp-content/plugins/cqpim/script-enqueing.php:1651) in /…/101_live/wp-
   content/plugins/mf-gig-calendar/mf_gig_calendar.php on line 961
 * Actually I think it seems to be a plugin-plugin issue in my case
 *  Thread Starter [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12195460)
 * Hey [@royzband](https://wordpress.org/support/users/royzband/),
    I had a quick
   look at your page and I think you can work with the workaround I posted if the
   current version is not working/till the update is working.
 * > As a quick workaround I replaced line 227 and 237
   >  $mfgigcal_date .= “<div 
   > class=\”day\”>” . date_i18n(“d”, $start_date) . “</div>”;
   > with
   >  $mfgigcal_date .= “<div class=\”day\”>” . $startArray[2] . “</div>”;
   > Same in line 244 but there with $endArray
   >  $mfgigcal_date .= “<div class=\”
   > day\”>” . $endArray[2] . “</div>”;
    -  This reply was modified 6 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Deleted offer for email
 *  [royzband](https://wordpress.org/support/users/royzband/)
 * (@royzband)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12196496)
 * Thankyou for your help. I’m not sure where to find these lines 227 and 237
 *  Thread Starter [clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/)
 * (@clemensfuhrbach)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12196526)
 * in
    mf_gig_calendar.php
 * Line 215ff
 * > function mfgigcal_FormatDate($start_date, $end_date) { // FUNCTION ///////////
 *  [royzband](https://wordpress.org/support/users/royzband/)
 * (@royzband)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12196586)
 * OK, I found where to edit those lines but am getting an error when trying to 
   save:
 * Your PHP code changes were rolled back due to an error on line 227 of file wp-
   content/plugins/mf-gig-calendar/mf_gig_calendar.php. Please fix and try saving
   again.
 * syntax error, unexpected ‘class’ (T_CLASS)
 *  [royzband](https://wordpress.org/support/users/royzband/)
 * (@royzband)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12197828)
 * So workaround not working in my case. Matthew, is there a patch or update somewhere?
   Someone mentioned trying it, but I don’t see where I can download it.
    If not,
   what is the timeline for getting a fix. I’m getting a bit desperate, so to avoid
   fans showing up on wrong dates I now will go in and adjust our dates one day 
   later to make them appear correct online. But then everything will be messed 
   up again once fixed, so I don’t want to manually change too much. thank you, 
   and sorry this is a problem for you. I love your plug-in……
 *  Plugin Author [Matthew Fries](https://wordpress.org/support/users/brewermfnyc/)
 * (@brewermfnyc)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12198980)
 * Sorry to be MIA on this. Crazy busy in my normal life at the moment.
 * The only way I was able to replicate this problem was by messing with my time
   zone in WP. The tool that provides the translated dates (so it can be in many
   languages) doesn’t handle time zones very well. My latest update 1.0.4 fixed 
   that for me on my couple testing servers. So I’m just guessing at what might 
   be the problem for you. Still looking for a solution here.
 * If you contact me directly through my website I might be able to help you specifically–
   at least temporarily until I find a real solution.
 * Sorry for the problems here. Again I’ve got 3-4 different versions of WP running
   on different versions of PHP and can’t replicate the problem…
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12200099)
 * [@clemensfuhrbach](https://wordpress.org/support/users/clemensfuhrbach/) Do not
   post your email address in these forums again. Off forum contact has gone amazingly
   bad in the past so please keep it here.
 * If you are not the original person who posted this topic and need support then
   per the forum guidelines please start your own topic.
 * [https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too](https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too)
 * You can do so here.
 * [https://wordpress.org/support/plugin/mf-gig-calendar/#new-post](https://wordpress.org/support/plugin/mf-gig-calendar/#new-post)
 *  [jadeburn](https://wordpress.org/support/users/jadeburn/)
 * (@jadeburn)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12231876)
 * Update on problem reported by [@royzband](https://wordpress.org/support/users/royzband/)
 * Dates were still showing as -1 day.
 * After reading through this thread, I tried changing the timezone in WP settings.
 * Previous settings were UTC-05, and I changed it to use “New York” and that solved
   the problem. The dates are now showing correctly.
 * I didn’t dig deeper than that, so I don’t know whether the change worked because
   WP treats a name-based timezone differently, or if all that was required was 
   a resetting of the timezone.
 * But either way, it worked.
 *  [jadeburn](https://wordpress.org/support/users/jadeburn/)
 * (@jadeburn)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/wrong-date-day-1/#post-12247328)
 * Disappointing further update on problem reported by [@royzband](https://wordpress.org/support/users/royzband/)
 * After a few days, we noticed that the problem was still there, but this time 
   with a twist that may be noteworthy or not.
 * Dates within the next 90 days are still shown correctly, but dates more than 
   90 days in the future are showing with the 1-day offset (-1) on the public view.
 * One additional observation that may help is that the problem is even noticeable
   within the admin pages:
    - The admin “upcoming performances” list view also shows the -1-day offset.
    - The admin “add/edit” view must be set +1-day in order to counteract the -1-
      day offset in the other views.
 * I’m not sure what could explain this. Perhaps the plugin author has some thoughts.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/wrong-date-day-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wrong-date-day-1/page/2/?output_format=md)

The topic ‘Wrong Date (Day -1)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mf-gig-calendar.svg)
 * [MF Gig Calendar](https://wordpress.org/plugins/mf-gig-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mf-gig-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mf-gig-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/mf-gig-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mf-gig-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mf-gig-calendar/reviews/)

 * 21 replies
 * 11 participants
 * Last reply from: [earlmacdon](https://wordpress.org/support/users/earlmacdon/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/wrong-date-day-1/page/2/#post-12297612)
 * Status: not resolved