{"id":1842,"date":"2012-01-01T16:18:57","date_gmt":"2012-01-01T14:18:57","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1842"},"modified":"2025-06-02T20:43:40","modified_gmt":"2025-06-02T18:43:40","slug":"send-icalendar-meeting-requests-for-different-timezone","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/send-icalendar-meeting-requests-for-different-timezone","title":{"rendered":"Send iCalendar meeting requests for different timezone"},"content":{"rendered":"\n<p>Usually you define time of an event in relation to current time zone. If you want to send such event to recipient in different time zone you should use <strong>UTC<\/strong>. This way you can be sure that you both meet at correct time.<\/p>\n\n\n\n<p>First add all necessary namespaces:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C# version\n\nusing System;\nusing Limilabs.Mail;\nusing Limilabs.Mail.Appointments;\nusing Fluent = Limilabs.Mail.Fluent;\nusing Limilabs.Client.SMTP;\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: vb; title: ; notranslate\" title=\"\">\n' VB.NET version\n\nImports System;\nImports Limilabs.Mail;\nImports Limilabs.Mail.Appointments;\nImports Fluent = Limilabs.Mail.Fluent;\nImports Limilabs.Client.SMTP;\n\n<\/pre><\/div>\n\n\n<p>The easiest way to achieve this is to create specify time using local <em>DateTime <\/em>instance and invoke <em>ToUniversalTime<\/em> method, which translates it to UTC timezone. This also handles daylight saving time differences.<\/p>\n\n\n\n<p>You can also use overloaded <em>DateTime <\/em>constructor that uses UTC timezone: DateTime(2012, 08, 17, 12, 00, 00, DateTimeKind.Utc).<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ C#\n\nDateTime start = new DateTime(2012, 08, 17, 12, 00, 00)\n    .ToUniversalTime();\n\nAppointment appointment = new Appointment();\nEvent e = appointment.AddEvent();\ne.Start = start;\ne.End = start + TimeSpan.FromMinutes(30);\ne.Summary = \"At noon\";\n\ne.SetOrganizer(new Person(\"Alice\", \"alice@example.org\"));\n\ne.AddParticipant(\n    new Participant(\"Bob\", \"bob@example.org\", ParticipationRole.Required, true));\ne.AddParticipant(\n    new Participant(\"Tom\", \"om@example.org\", ParticipationRole.Optional, true));\ne.AddParticipant(\n    new Participant(\"Alice\", \"alice@example.org\", ParticipationRole.Required, true));\n\nAlarm alarm = e.AddAlarm();\nalarm.BeforeStart(TimeSpan.FromMinutes(15));\n\nIMail email = Fluent.Mail\n    .Text(\"Status meeting at noon.\")\n    .Subject(\"Status meeting\")\n    .From(\"alice@example.org\")\n    .To(\"bob@example.org\")\n    .To(\"tom@example.org\")\n    .AddAppointment(appointment)\n    .Create();\n\nusing (Smtp client = new Smtp())\n{\n    client.ConnectSSL(\"smtp.example.org\");\n    client.UseBestLogin(\"user\", \"password\");\n    client.SendMessage(email);\n    client.Close();\n}\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: vb; title: ; notranslate\" title=\"\">\n' VB.NET\n\nDim start As DateTime = New DateTime(2012, 8, 17, 12, 0, 0) _\n    .ToUniversalTime()\n\nDim appointment As New Appointment()\nDim e As &#x5B;Event] = appointment.AddEvent()\ne.Start = start\ne.&#x5B;End] = start + TimeSpan.FromMinutes(30)\ne.Summary = \"At noon\"\n\ne.SetOrganizer(New Person(\"Alice\", \"alice@example.org\"))\n\ne.AddParticipant( _\n    New Participant(\"Bob\", \"bob@example.org\", ParticipationRole.Required, True))\n\ne.AddParticipant( _\n    New Participant(\"Tom\", \"tom@example.org\", ParticipationRole.&#x5B;Optional], True))\n\ne.AddParticipant( _\n    New Participant(\"Alice\", \"alice@example.org\", ParticipationRole.Required, True))\n\nDim alarm As Alarm = e.AddAlarm()\nalarm.BeforeStart(TimeSpan.FromMinutes(15))\n\nDim email As IMail = Fluent.Mail.Text(\"Status meeting at noon.\") _\n    .Subject(\"Status meeting\") _\n    .From(\"alice@example.org\") _\n    .&#x5B;To](\"bob@example.org\") _\n    .&#x5B;To](\"tom@example.org\") _\n    .AddAppointment(appointment) _\n    .Create()\n\nUsing client As New Smtp()\n    client.ConnectSSL(\"smtp.example.org\")\n    client.UseBestLogin(\"user\", \"password\")\n    client.SendMessage(email)\n    client.Close()\nEnd Using\n<\/pre><\/div>\n\n\n<p>Things get a bit more complicated if you want to <a href=\"\/blog\/send-icalendar-recurring-meeting-requests-different-timezone\">define recurring event in a different timezone<\/a> &#8211; you can not use UTC time zone in such case.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Usually you define time of an event in relation to current time zone. If you want to send such event to recipient in different time zone you should use UTC. This way you can be sure that you both meet at correct time. First add all necessary namespaces: The easiest way to achieve this is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15,33,26,50,57],"class_list":["post-1842","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-icalendar","tag-smtp","tag-vb-net"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1842"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=1842"}],"version-history":[{"count":10,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1842\/revisions"}],"predecessor-version":[{"id":6671,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1842\/revisions\/6671"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}