Reputation: 8177
My application stores the UTC offset on users profile (-03:00, for instance) and as this page from iCal.net Wiki mentions it seems that I can only use the timezone to assign to the event: https://github.com/rianjs/ical.net/wiki/Working-with-time-zones.
Do I have any other option?
Upvotes: 2
Views: 1803
Reputation: 7954
ical.net uses NodaTime under the hood to do time zone conversions, which means you can use the Etc/GMT
family of zones. Wikipedia has a nice list. In your case, you would specify a time zone of Etc/GMT-3
:
const string ianaZone = "Etc/GMT-3";
var start = DateTime.Now;
var end = start.AddHours(1);
var vEvent = new Event
{
DtStart = new CalDateTime(start, ianaZone),
DtEnd = new CalDateTime(end, ianaZone),
};
Upvotes: 2