mt-mods / mail

Mail mod for Luanti
https://content.minetest.net/packages/mt-mods/mail/
Other
14 stars 23 forks source link

Time zone of the date information #125

Closed HybridDog closed 6 months ago

HybridDog commented 10 months ago

The displayed time is not calculated with the time zone where the player lives. I think the time zone (e.g. UTC) should be mentioned to avoid confusion.

Athozus commented 10 months ago

Minetest doesn't support timezones. However, we might add an "UTC" in the default date formats, what do you think about this option ?

S-S-X commented 10 months ago

Minetest doesn't support timezones. However, we might add an "UTC" in the default date formats, what do you think about this option ?

You can get good enough results by asking for offset (default: 0) and just formatting with os.date. But have to add timezone configuration for users, for this I'd suggest allowing just setting offset hours (maybe minutes if there's extra space, whatever store in seconds).

Athozus commented 10 months ago

You can get good enough results by asking for offset (default: 0) and just formatting with os.date. But have to add timezone configuration for users, for this I'd suggest allowing just setting offset hours (maybe minutes if there's extra space, whatever store in seconds).

What do you mean exactly ? Adding a setting so the user configures itself his time offset ?

S-S-X commented 10 months ago

What do you mean exactly ? Adding a setting so the user configures itself his time offset ?

Exactly, method that's proven to work pretty much everywhere. You could always make a guess (for defaults) based on client info but that's probably not very good idea in the end.

After all most complicated parts of that is formspec inputs and key for config storage, it allows having local timestamps and calculation is simple for a result that's good enough.

Well, there won't be DST but I don't think that's really issue at all, just do old school DST adjustment by adjusting offset settings twice a year.

HybridDog commented 10 months ago

Always showing the time in UTC and mentioning "UTC" in the string is sufficient for me personally.

#

Well, there won't be DST but I don't think that's really issue at all, just do old school DST adjustment by adjusting offset settings twice a year.

I doubt that players would manually take care to adjust the offset twice a year.

Athozus commented 7 months ago

It will be the last feature for 1.4.0, so let's conclude a bit. Imho, the best option, following @S-S-X 's opinion is to add a new setting in Other group, which is added to the date time (then formatted with os.date, but Lua does it).

I think that @HybridDog 's solution might confuse some people.

Athozus commented 6 months ago

I noticed a problem, time will be wrong when the country (and most of do it) uses daylight saving time. The only valid option is to add UTC, until Minetest gives an API for it.

S-S-X commented 6 months ago

I noticed a problem, time will be wrong when the country (and most of do it) uses daylight saving time. The only valid option is to add UTC, until Minetest gives an API for it.

Yeah, mentioned this earlier in explanation. Thing is I think it isn't that bad if you can select UTC and have UTC as default:

Well, there won't be DST but I don't think that's really issue at all, just do old school DST adjustment by adjusting offset settings twice a year.

However reminding users that there's no DST would be nice, for this simple mention "DST not supported" or "Daylight saving time not supported" would likely suffice.

Having timezone selection now, even if not complete with all the shenanigans (DST isn't only one), would still be useful for some and would anyway allow gradually implementing wanted features.

Athozus commented 6 months ago

OK, then I will add the setting :wink: