I have used Icalendar in my project, I am facing a weird issue for recurrence request. I am passing DTSTART 28 march but calendar is generated for 29 march. recurrence is untill 30th march. My icalendar is as follow
BEGIN:VCALENDAR
PRODID:-//Team Test
VERSION:2.0
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Asia/Kolkata
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
TZNAME:IST
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20160328T223000Z
DTSTAMP:20160321T140058Z
DTEND:20160328T230000Z
RRULE:FREQ=DAILY;UNTIL=20160330T173000Z
LOCATION:
UID:request180107lvis.support#mycompanydomain.com
DESCRIPTION:Requester : Yadav, Chandikumar +() +919876543210
X-ALT-DESC;FMTTYPE=text/html:Requester : Yadav, Chandikumar +() +919876543210
SUMMARY:Conference Testing
ORGANIZER:MAILTO:test.support#mycompanydomain.com
ATTENDEE;ROLE=REQ-PARTICIPANT;CN="";RSVP=TRUE:mailto:chandikumar.yadav#mycompanydomain.com
ATTENDEE;ROLE=REQ-PARTICIPANT;CN="";RSVP=TRUE:mailto:jatin.kolhe#mycompanydomain.com
ATTENDEE;PARTSTAT=ACCEPTED;CN="Testing":mailto:test.lvis.support#mycompanydomain.com
ATTACH;FMTTYPE=message/rfc822:D:\Projects\abc.pdf
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
I have passed DTSTART, DTEND and UNTIL. Unable to figure out where is the problem.
You specified:
20160328T223000Z
Based on the rest of the iCalendar document, I'm guessing you are actually in this timezone:
Asia/Kolkata
Since that is UTC+5:30, I'm guessing the newly generated time is:
2016-03-29 04:00:00 in your own timezone
If you want to specify the time in your timezone currenctly, make sure you add TZID to all your DATE-TIME fields, such as DTSTART and don't include the Z at the end of the timestamp. (Z stands for Zulu time, which is UTC)
Related
My application uses ical.net to process iCal appointments. In some cases I have to convert the appointment to the time zone of the participants. Since I currently use Nodatime for all date operations, I would like to convert the start and end date of the appointment into a ZonedDateTime object (or into another Nodatime type with which I can convert between time zones).
For this, I first have to convert the time zone embedded in the iCal into a Nodatime type.
My question is:
Can the time zone definition below be parsed into an equivalent Nodatime type so that I can convert the appointment to other time zones?
If so, what is the best way to do it? I can't imagine being the first to have this problem.
If not, is there any other way to implement my process? Or am I completely on the wrong track and have to think of another implementation?
BEGIN:VTIMEZONE
TZID:(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
Update
For the sake of completeness, here is the entire iCal file:
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN="John Doe":MAILTO:john#doe.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Jane Doe
:MAILTO:jane#doe.com
DESCRIPTION:Description
UID:ical-uid
SUMMARY:Summary
DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2
0210427T100000
DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":202
10427T110000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20210419T125618Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:2
LOCATION:Location
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
I have configured a template with an exploration date:
Get-AipServiceTemplateProperty -TemplateId 7a3e9ebd-a14e-4520-ba34-434029030633 -ContentExpirationDate -ContentExpirationOption | Format-List
Key : ContentExpirationOption
Value : OnDate
Key : ContentExpirationDate
Value : 12/25/2020 11:56:00 AM
And then I set protection to file with this template
ProtectionDescriptor protectionDescriptor = new ProtectionDescriptor("7a3e9ebd-a14e-4520-ba34-434029030633");
The file successfully encrypted and the permission is set but it looks like the exploration date didn't work. When I open the file Word doesn't show me until when the file is valid.
For this problem, as it shows 12/25/2020 11:56:00 AM for the key ContentExpirationDate but you didn't find it work. So please check the the time zone of the expiration date, check if it matches UTC time zone and doesn't match your local time zone.
In my application of event management, i create a calendar file which is sent with the registration confirmation email. The application is in .NET with C#. I use following code to get the time.
sdate = row1.StartTime.ToUniversalTime().ToString("yyyyMMddThhmmssZ");
edate = row1.EndTime.ToUniversalTime().ToString("yyyyMMddThhmmssZ");
...
and then i add it to calendar file
contents.Add("DTSTART:" + sdate);
contents.Add("DTEND:" + edate);
But the problem is that if my end time is 3:59 PM local time then it coverts correctly. But if it ends at 4:00 PM then end time becomes incorrect.
Can anybody guide me?
Please find below the Screens of Outlook Calendar Entry and Calendar File data.
Correct Output
Incorrect Output
I finally found the solution. It is such a simple one that its disappointing that I missed it.
Just to help others. I just need to put capital 'H' in the string format when converting to string. So the correct code is
sdate = row1.StartTime.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
edate = row1.EndTime.ToUniversalTime().ToString("yyyyMMddTHHmmssZ");
I have a program that runs the following code on C#:
TimeZoneInfo localZone = TimeZoneInfo.Local;
string timeZone = TimeZoneInfo.FindSystemTimeZoneById(localZone.Id).ToString();
MessageBox.Show("Local Time Zone ID: " + timeZone);
When I run this, I got the following exception:
System.TimeZoneNotFoundException: The time zone ID 'Malay Peninsula Standard Time' was not found on the local computer.
I made a slight modification on the code and used this line:
TimeZoneInfo localZone = TimeZoneInfo.Local;
MessageBox.Show("Local Time Zone ID: " + localZone.StandardName);
And this time I got no exception, and I got the popup message with the time zone "Malay Peninsula Standard Time"
Why the first fragment of code is not working?
After some time (days), I finally found out what was happening.
Debugging the code, I see that TimeZoneInfo.Local.Id was retrieving the following value:
Malay Peninsula Standard Time
I made some investigation, and found out that all the time zones for the server are stored on this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\
If you browse through them, you will see that no key is called "Malay Peninsula Standard Time", the value that is for that time zone is "Singapore Standard Time". The whole information for that time zone is the following:
ID: Singapore Standard Time
Display Name: (GMT+08:00) Kuala Lumpur, Singapore
Standard Name: Malay Peninsula Standard Time
Daylight Name: Malay Peninsula Daylight Time ***Does Not Have Daylight Saving Time***
Offset from UTC: 8 hours, 0 minutes
Number of adjustment rules: 0
So, as you see, the ID that I was looking for did not exist, and that's why I got that exception. I renamed the registry key to "Malay Peninsula Standard Time" and the problem was gone.
I am using OpenPoup.NET to read email from Gmail. I want to identify original sender, receiver, date and subject of forwarded message. My email looks like,
----------------------Email Body starts-----------------------------------
FYI, read below email to get idea of button.
Chirag Developer XYZ Limited
From: Rat Chanra [mailto:rat#chanra.com] Sent: Friday, June 5, 2015
9:48 PM To: Chirag Subject: FW: Copy Product Button
Hi Rat,
I have included a .png of the copy product button. Attached also is an
.eps of updated buttons if we feel like updating all the buttons!
Let's chat,
Ali Designer
----------------------Email Body Ends-----------------------------------
I want to find From, Date, Sublect and To of original message, which is in this case,
From = rat#chanra.com
Date = Friday, June 5, 2015 9:48 PM
To = Chirag
Subject = FW: Copy Product Button
Can I do this using OpenPopUp.net?
Do I have to parse email body using RegEx and fetch above detail. If yes, what is best way for that? I am using C#
You can use the following to match:
From:\s+[^[]+\s+\[mailto:([^\]]+)\]\s+Sent:\s+(\w+,\s+\w+\s+\d+,\s+\d{4}\s+[\d:]+\s+[aApP]M)\s+To:\s+(\w+)\s+Subject:\s+(.*)
And extract From as $1, Date as $2, To as $3 and Subject as $4.
See DEMO