1

I help run a forum using the Simple Machines Forum framework. The forum's time settings are correct--all the posts show up as the correct time for the poster's time zone.

We installed a plugin (SMF calls it a package) for a little online-user chat function. The timestamp on this chat program is not correct--it doesn't match the forum. I am based in Michigan (GMT-4), but it always shows four hours later than my current time (GMT 0).

I have done a huge amount of research on this and here is what I've got.

Have you changed the php.ini file in the root directory's date.timezone setting?

Yes.

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/New_York"

Have you modified the index.php file in the plugin directory's date_default_timezone_set setting?

Yes.

if (!ini_get('date.timezone'))
    date_default_timezone_set('America/New_York');

I'm not terribly well versed in PHP, so I might have added a space or missed a semicolon or something that I just wouldn't know to notice. One thing I DID notice is that the timestamps of previous messages (before a hard refresh) in the chat log will adjust the time if I change the timezone. Current messages however still stick at GMT0, so I wonder if something somewhere is overriding the timezone I'm trying to set for it.

I'm at an absolute loss for what to check next. I'm out of my depth, as it is.

  • Must be something in this "plugin" changing your date. Do you have a link to the code? – miken32 Mar 31 '17 at 02:54
  • Hi @miken32, here's the link to the mod itself: [SA Chat](http://custom.simplemachines.org/mods/index.php?mod=2534) If you want to, you could download the mod and just crack open the ZIP file to take a look at the code. – OtterlyAdorable Mar 31 '17 at 02:56
  • agree with the others look for this "date_default_timezone_set" inside the plugin – Gert Mar 31 '17 at 03:00
  • Just did a quick grep over the contents for `ini_set`, `timezone`, and `tz` with no luck. I'd work with the guy who wrote it, as he's probably more familiar with how it works. – miken32 Mar 31 '17 at 03:02
  • @Gert, I did. As I mentioned in my original post, I have already changed that, but it's still not working. – OtterlyAdorable Mar 31 '17 at 03:03
  • @miken32 Yeah, he hasn't been responsive on the feedback section for a while. That's why I thought I'd try here. =P – OtterlyAdorable Mar 31 '17 at 03:05

0 Answers0