Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server timezone configuration #1680

Open
yarmoliq opened this issue Nov 11, 2024 · 4 comments
Open

Server timezone configuration #1680

yarmoliq opened this issue Nov 11, 2024 · 4 comments

Comments

@yarmoliq
Copy link

yarmoliq commented Nov 11, 2024

Currently server time zone is configured using double (hours offset). What if the server has a timezone where they switch to winter/summer time? Then the offset will be dynamic, not constant? Maybe timezone configuration should use standard dotnet functionality that can account for such cases?

@yarmoliq yarmoliq changed the title Server timezone Server timezone configuration Nov 11, 2024
@FanDjango
Copy link
Collaborator

As you seem to have a clear preconception of the technique and details of what should be done, could you provide details / code / PR of a possible enhancement towards this goal?

@yarmoliq
Copy link
Author

Here is an example of using TimeZoneInfo:

TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
DateTime currentEasternTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone);

@FanDjango
Copy link
Collaborator

Oh, thanks. So?

@FanDjango
Copy link
Collaborator

As FTP servers report times (such as file creation timestamps) in a way that is undefined in the RFCs, typically though UTC, any timezone logic in FluentFTP is actually just added value - there is no-one stopping you from converting times again yourself in those cases where you know the timezone of the server, i.e. you know the server and its locale.

If you think that there should be additional code in the current timezone logic (which is just there to help a little bit), then be so kind as to provide it and save us some work.

I do also think you might have a valid point to do automatic daylight saving time conversion as it setup for those locations that have that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants