Confusing timestamp issues

Discuss Tiny Tiny IRC here
mariposa
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 23 Jul 2013, 14:30

Confusing timestamp issues

Postby mariposa » 10 May 2014, 21:34

I'm not sure how long this has been going on. It may be a problem that recently surfaced or it might be something that's always happened and I never noticed. Anyway! In both the web interface and Android client, when I send a message to a channel/query, the timestamp is always UTC. When I receive a message, it's the timezone the system running Tiny Tiny IRC is configured to use. I looked through the code and only found one reference to timezones, in include/db-prefs.php, where it's talking about a USER_TIMEZONE preference, but that doesn't seem to actually do anything. Is there something that I'm missing where the timezone for the user is determined?

Thanks! :)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Confusing timestamp issues

Postby fox » 10 May 2014, 22:17

I don't remember how this works exactly but I don't think tt-irc does any timezone conversion. It should use whatever you have configured in php.ini / database.

The code mentions might be because I pulled some stuff from tt-rss when I started working on tt-irc which actually supports timezones properly.

e: insert into ttirc_messages uses NOW() as timestamp so client/android time shouldn't factor into it I think. I didn't notice anything like that either.

mariposa
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 23 Jul 2013, 14:30

Re: Confusing timestamp issues

Postby mariposa » 10 May 2014, 22:48

Any idea why the timestamp for me sending a message would be a different timezone than the one when I receive a message? I have the timezone set in php.ini, but maybe something is wrong there. I guess all messages received are received through the Java backend, not touching PHP at all, right? So maybe it is a PHP misconfiguration issue... weird.

ETA: I've checked and double-checked the date.timezone setting in php.ini. It's set to America/Chicago and that's also what's reflected in phpinfo(), so I really have no idea where the different timezone is coming from.

mariposa
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 23 Jul 2013, 14:30

Re: Confusing timestamp issues

Postby mariposa » 10 May 2014, 23:10

I FIXED IT! It wasn't PHP or Tiny Tiny IRC at all. Somehow the timezone was set to UTC with PostgreSQL. I've never noticed that before, especially since it's different than the system timezone.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Confusing timestamp issues

Postby fox » 10 May 2014, 23:32

Yeah I guess this is entirely dependent on the database configuration. Sorry if my post was misleading.

mariposa
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 23 Jul 2013, 14:30

Re: Confusing timestamp issues

Postby mariposa » 10 May 2014, 23:44

It wasn't misleading at all. When you pointed out that the inserts use NOW(), it made me think about the database configuration. So that actually led me right where I needed to go. :D


Return to “Tiny Tiny IRC”

Who is online

Users browsing this forum: No registered users and 1 guest