{"action":"created","issue":{"url":"https://api.github.com/repos/rianjs/ical.net/issues/89","repository_url":"https://api.github.com/repos/rianjs/ical.net","labels_url":"https://api.github.com/repos/rianjs/ical.net/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/rianjs/ical.net/issues/89/comments","events_url":"https://api.github.com/repos/rianjs/ical.net/issues/89/events","html_url":"https://github.com/rianjs/ical.net/issues/89","id":169357289,"number":89,"title":"Date/Time Stamp should be in UTC without TimeZone property","user":{"login":"kdaveid","id":14823432,"avatar_url":"https://avatars.githubusercontent.com/u/14823432?v=3","gravatar_id":"","url":"https://api.github.com/users/kdaveid","html_url":"https://github.com/kdaveid","followers_url":"https://api.github.com/users/kdaveid/followers","following_url":"https://api.github.com/users/kdaveid/following{/other_user}","gists_url":"https://api.github.com/users/kdaveid/gists{/gist_id}","starred_url":"https://api.github.com/users/kdaveid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdaveid/subscriptions","organizations_url":"https://api.github.com/users/kdaveid/orgs","repos_url":"https://api.github.com/users/kdaveid/repos","events_url":"https://api.github.com/users/kdaveid/events{/privacy}","received_events_url":"https://api.github.com/users/kdaveid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-04T11:57:52Z","updated_at":"2016-08-17T15:33:54Z","closed_at":null,"body":"As of RFC `4.8.7.2 Date/Time Stamp` [here](http://www.kanzaki.com/docs/ical/dtstamp.html) or [here](https://www.ietf.org/rfc/rfc2445.txt) the DTSTAMP property should be of UTC but without the TimeZone property.\r\n\r\nUnfortunately (as I see it) we have no influence on this particular DateTime property during serialization. \r\n\r\n_Or do you have any ideas how to strip the TZID when serialize this property?_\r\n\r\n**EnsureProperties() method**\r\nAdditionally and in this matter I propose the followin code change for the default value of DTSTAMP: \r\n\r\n```\r\nif (DtStamp == null)\r\n{\r\nvar now = DateTime.SpecifyKind(DateTime.Today.Add(DateTime.UtcNow.TimeOfDay), DateTimeKind.Utc);\r\nDtStamp = new CalDateTime(now);\r\n}\r\n```\r\nThis way the CalDateTime() variable has the property `IsUniversalTime` set `true`.\r\n\r\nOriginal:\r\n```\r\nif (DtStamp == null)\r\n{\r\n  // Here, we don't simply set to DateTime.Now because DateTime.Now contains milliseconds, and\r\n  // the iCalendar standard doesn't care at all about milliseconds.  Therefore, when comparing\r\n  // two calendars, one generated, and one loaded from file, they may be functionally identical,\r\n  // but be determined to be different due to millisecond differences.\r\n  var now = DateTime.Now;\r\n  DtStamp = new CalDateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);\r\n}\r\n```\r\nFrom [here](https://github.com/rianjs/ical.net/blob/master/ical.NET/Components/UniqueComponent.cs#L42-L50).\r\n\r\nThe problem is we get the followin output when serializing:\r\n```\r\nBEGIN:VCALENDAR\r\nPRODID:TESTCAL\r\nVERSION:2.0\r\nX-WR-CALNAME:X-WR-CALNAME:Test\r\nBEGIN:VEVENT\r\nDESCRIPTION:Description\r\nDTEND;TZID=W. Europe Standard Time:20160804T150000\r\nDTSTAMP;TZID=UTC:20160804T110635Z\r\nDTSTART;TZID=W. Europe Standard Time:20160804T140000\r\nSEQUENCE:0\r\nSUMMARY:Test-Event\r\nUID:1234\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n```\r\nWith [ical-validator](http://ical-validator.herokuapp.com/) we get `Parser error at line 8: Cannot set timezone for UTC properties`.\r\n\r\nWhen removed we have no errors.\r\n"},"comment":{"url":"https://api.github.com/repos/rianjs/ical.net/issues/comments/240450738","html_url":"https://github.com/rianjs/ical.net/issues/89#issuecomment-240450738","issue_url":"https://api.github.com/repos/rianjs/ical.net/issues/89","id":240450738,"user":{"login":"khalidabuhakmeh","id":228256,"avatar_url":"https://avatars.githubusercontent.com/u/228256?v=3","gravatar_id":"","url":"https://api.github.com/users/khalidabuhakmeh","html_url":"https://github.com/khalidabuhakmeh","followers_url":"https://api.github.com/users/khalidabuhakmeh/followers","following_url":"https://api.github.com/users/khalidabuhakmeh/following{/other_user}","gists_url":"https://api.github.com/users/khalidabuhakmeh/gists{/gist_id}","starred_url":"https://api.github.com/users/khalidabuhakmeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khalidabuhakmeh/subscriptions","organizations_url":"https://api.github.com/users/khalidabuhakmeh/orgs","repos_url":"https://api.github.com/users/khalidabuhakmeh/repos","events_url":"https://api.github.com/users/khalidabuhakmeh/events{/privacy}","received_events_url":"https://api.github.com/users/khalidabuhakmeh/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T15:33:54Z","updated_at":"2016-08-17T15:33:54Z","body":"I reviewed the PRs and they LGTM. It would be nice to have an CI build going which I can setup on AppVeyor if you would like at some point. #86 "}}
{"actor":{"display_login":"khalidabuhakmeh"}}