Global log module: timezone setting. #651

Open
opened 2026-10-05 04:36:23 +02:00 by adam · 10 comments
Owner

There is no setting to allow a default to be set by admins or for the admin/user logs.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

There is no setting to allow a default to be set by admins or for the admin/user logs. ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28943460-global-log-module-timezone-setting?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:120976165 -->
Author
Owner

There is a setting:

export TZ=Europe/Dublin

in shell before starting ZNC.

There is a setting: ``` export TZ=Europe/Dublin ``` in shell before starting ZNC. <!-- github-comment-id:162841505 -->
Author
Owner

Or TZ=Europe/Helsinki znc, but I am in favour of global option for it (defaulting to $TZ).

At IRC I commented that the timezone option is deprecated because of server-time, but I didn't think about global log module.

I think that it's more clear for the global log module to be in the timezone of ZNC admin than UTC for random users. (UTC comes from the fact that server-time uses it, doesn't it?)

Or `TZ=Europe/Helsinki znc`, but I am in favour of global option for it (defaulting to `$TZ`). At IRC I commented that the timezone option is deprecated because of [server-time](http://ircv3.net/specs/extensions/server-time-3.2.html), but I didn't think about global [log](http://wiki.znc.in/log) module. I think that it's more clear for the global [log](http://wiki.znc.in/log) module to be in the timezone of ZNC admin than UTC for random users. _(UTC comes from the fact that server-time uses it, doesn't it?)_ <!-- github-comment-id:162843230 -->
Author
Owner

(UTC comes from the fact that server-time uses it, doesn't it?)

No, it doesn't.

> (UTC comes from the fact that server-time uses it, doesn't it?) No, it doesn't. <!-- github-comment-id:162843485 -->
Author
Owner

(UTC comes from the fact that server-time uses it, doesn't it?)

No, it doesn't.

Am I misunderstanding the spec then?

When enabled, the server-time extension enables optional time message tag which can be used in messages from server to client. The value of the tag MUST have the following syntax:

<value> ::= YYYY-MM-DDThh:mm:ss.sssZ

It represents a calendar date and time of day in UTC using extended format, as specified by ISO 8601:2004(E) 4.3.2. Precision of the time is one millisecond.

> > (UTC comes from the fact that server-time uses it, doesn't it?) > > No, it doesn't. Am I misunderstanding [the spec](http://ircv3.net/specs/extensions/server-time-3.2.html) then? > When enabled, the server-time extension enables optional time message tag which can be used in messages from server to client. The value of the tag MUST have the following syntax: > > `<value> ::= YYYY-MM-DDThh:mm:ss.sssZ` > > It represents a calendar date and time of day in UTC using extended format, as specified by ISO 8601:2004(E) 4.3.2. Precision of the time is one millisecond. <!-- github-comment-id:162852299 -->
Author
Owner

server-time is property of client connection, not of ZNC user.

If client supports server-time, the time is sent in UTC as per spec, and user setting is ignored.
If client doesn't support server-time, the time is sent in the configured timezone, inside text part of messages.

Log module uses the user setting too. For global log module it's not so useful.

`server-time` is property of client connection, not of ZNC user. If client supports server-time, the time is sent in UTC as per spec, and user setting is ignored. If client doesn't support server-time, the time is sent in the configured timezone, inside text part of messages. Log module uses the user setting too. For global log module it's not so useful. <!-- github-comment-id:162863876 -->
Author
Owner

server-time is property of client connection, not of ZNC user.

But ZNC is a client which should also support server-time?

If client supports server-time, the time is sent in UTC as per spec, and user setting is ignored.
If client doesn't support server-time, the time is sent in the configured timezone, inside text part of messages.

But ZNC connects to server while you are only talking about client and ZNC?

Log module uses the user setting too. For global log module it's not so useful.

It would still be nice to be able to define timezone for the global log module, as I said earlier: Or TZ=Europe/Helsinki znc, but I am in favour of global option for it (defaulting to $TZ).

> server-time is property of client connection, not of ZNC user. But ZNC is a client which should also support `server-time`? > If client supports server-time, the time is sent in UTC as per spec, and user setting is ignored. > If client doesn't support server-time, the time is sent in the configured timezone, inside text part of messages. But ZNC connects to server while you are only talking about client and ZNC? > Log module uses the user setting too. For global log module it's not so useful. It would still be nice to be able to define timezone for the global log module, as I said earlier: _Or `TZ=Europe/Helsinki znc`, but I am in favour of global option for it (defaulting to `$TZ`)._ <!-- github-comment-id:162875285 -->
Author
Owner

DarthGandalf changed the title from* Global ZNC Timezone setting_. to *Global log module: timezone setting_. an hour ago

I missed this part. Is there any other global module or some reason third party module would need to be able to have global timezone or it's own option for setting timezone? If not, then I am fine with the current title.

> DarthGandalf changed the title from\* Global ZNC Timezone setting_. to *Global log module: timezone setting_. an hour ago I missed this part. Is there any other global module or some reason third party module would need to be able to have global timezone or it's own option for setting timezone? If not, then I am fine with the current title. <!-- github-comment-id:162875573 -->
Author
Owner

But ZNC connects to server while you are only talking about client and ZNC?

Log module ignores existence of server-time, even if message contains the tag, and uses local time + user's TZ setting anyway.
I'll open a separate issue about it.

> But ZNC connects to server while you are only talking about client and ZNC? Log module ignores existence of `server-time`, even if message contains the tag, and uses local time + user's TZ setting anyway. I'll open a separate issue about it. <!-- github-comment-id:162899808 -->
Author
Owner

Do I understand this correctly, one can use export TZ=UTC to log in UTC?

This is a pain point for me due to changing local timezones (CET/CEST).

Do I understand this correctly, one can use `export TZ=UTC` to log in UTC? This is a pain point for me due to changing local timezones (CET/CEST). <!-- github-comment-id:1699722365 -->
Author
Owner

Yes, if you then start ZNC manually. It may be better to specify in your init or cron or however you generally start ZNC.

Yes, if you then start ZNC manually. It may be better to specify in your init or cron or however you generally start ZNC. <!-- github-comment-id:1701114527 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#651