-
Notifications
You must be signed in to change notification settings - Fork 26
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
How to handle correct timezone settings? #13
Comments
The iCalendar format is well defined and won't change from client to client. If it works in Outlook but doesn't work in a different client, then the other client is handling the file differently or perhaps ignoring parts it doesn't support. If it imports correctly with the time zone but converts it to UTC and strips the time zone out when saved, more likely than not, the client application doesn't support time zones on the events when it exports them. If you have the option, try creating an event within the client application with time zone info and export it from the client application to an iCalendar file to see how it writes the event out. That should give you some idea of what its expecting when it imports one and if it keeps the time zone info when it writes it back out. If you want to add the time zone information to the saved calendar, you'll need to load the available time zone settings into the calendar's static The TimeZoneRegInfo class may be of help there as it shows how to build a full set of time zone info from the registry and load it into the |
Thanks, so as I understand...it's a must to set the timezone collection in calendar class first and add all timezones which occur in the events. Afzer that I can use Timezones in the event ? So how can determine the right timezone string to set ? With respect to daylight saving time. Do I have to set the offset value to the event start and enddate or is that calculated from timezone info in the event? I am sorry but its really difficult to understand. |
If you use the If you set the date/times on the event using their |
Thank you so much, but on Linux I cannot use the timezone class. Can I build these in .net natively? Sorry for those maybe stupid questions Have a great day |
You can build them yourself. You can see how in the noted class. They only difference would be that you'd have to load them from a different data source rather than the registry such as the IANA time zone database. A simpler approach would be to run the PDIWinFormsTest on a Windows PC, open the time zone demo form and use the Save option to save all the time zone info to a calendar file. You can then load that when your application starts up and that info will get loaded into the calendar's time zone collection so it functions the same way. Whichever way you handle it, you'd need to keep the data source files used up to date as the time zone info changed over time. |
Thank you so much, got it working. And for the Timezone info ... as we are in .NET anyway maybe TimezonInfo would be better fit, which works also on .NET Standard |
Hi,
I'm really struggling ... could you plaese help to get the following code running.
I have some infos about classes from previous years ... HOW can I set the right timezone ? All dates are in Vienna timezone (with daylight simmertime in case), which is the local datetime.
Some clients like Outlook work but some push the date back to UTC when editing ...
So the overall goal would be to write 1 event to a overall valid ical file which is opened everywhere.
I have seen the Timezone section in the sample files but do not know how to add these!
Maybe you could also add this to the docs because I think this is one of the main purposes when using your library.
Anyway, awesome library! (too awesome for me at the moment :))
The text was updated successfully, but these errors were encountered: