{"action":"closed","issue":{"url":"https://api.github.com/repos/mspnp/semantic-logging/issues/87","repository_url":"https://api.github.com/repos/mspnp/semantic-logging","labels_url":"https://api.github.com/repos/mspnp/semantic-logging/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/mspnp/semantic-logging/issues/87/comments","events_url":"https://api.github.com/repos/mspnp/semantic-logging/issues/87/events","html_url":"https://github.com/mspnp/semantic-logging/issues/87","id":161881758,"number":87,"title":"WindowsAzureTableSink : PartitionKey is 2 hours behind when running on \"BST\"","user":{"login":"aboobolaky","id":8258754,"avatar_url":"https://avatars.githubusercontent.com/u/8258754?v=3","gravatar_id":"","url":"https://api.github.com/users/aboobolaky","html_url":"https://github.com/aboobolaky","followers_url":"https://api.github.com/users/aboobolaky/followers","following_url":"https://api.github.com/users/aboobolaky/following{/other_user}","gists_url":"https://api.github.com/users/aboobolaky/gists{/gist_id}","starred_url":"https://api.github.com/users/aboobolaky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboobolaky/subscriptions","organizations_url":"https://api.github.com/users/aboobolaky/orgs","repos_url":"https://api.github.com/users/aboobolaky/repos","events_url":"https://api.github.com/users/aboobolaky/events{/privacy}","received_events_url":"https://api.github.com/users/aboobolaky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-23T09:46:33Z","updated_at":"2016-06-29T08:46:50Z","closed_at":"2016-06-29T08:46:50Z","body":"Hi,\r\n\r\nRe: WIndowsAzureTableSink\r\n\r\nThe EventDate (as well as timestamp) are UTC-based.\r\nWhen the partition key is generated in DateTimeExtensions.cs (either normal WAD style gen or reverse timestamped), the eventdate is passed in as a parameter and a datetime object is created out of it, elimating the seconds and most importantly the DateTimeKind.\r\n\r\nThe upshot of this is calling ToUniversalTime() again on a machine that is already on BST causes the partition key to be behind by 2 hours (instead of 1hr) \r\n \r\n`public static string GeneratePartitionKeyReversed(this DateTime dateTime)        {`  \r\n`           dateTime = dateTime.AddMinutes(-1D);`  \r\n`          var pk = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, ``     dateTime.Minute, 0);`  \r\n`            return GetTicksReversed(pk);`  \r\n`        } `  \r\n\r\n\r\n` internal static string GetTicksReversed(this DateTime dateTime)`\r\n `       {`\r\n          `  return (DateTime.MaxValue - dateTime.ToUniversalTime()).Ticks.ToString(\"d19\", CultureInfo.InvariantCulture);`\r\n`       }`\r\n\r\n**example**  \r\n(EventDate is in UCT and events are being collected on a machine which is on BST)\r\n\r\nMachine Time : 2016-06-22T14:12:14.6980463Z\r\nEventDate :       2016-06-22T13:12:14.6980463Z (OK)\r\nTimestamp:       2016-06-22T13:12:53.6490621Z (OK)\r\n\r\nPartition Key : 2519357033399999999\r\n\r\nif we convert the partition key back to it's orginal state ,  the value is 22/06/2016 12:11:00 when in fact it should be \"22/06/2016 13:11:00\" (which should be 1 minute behind the EventDate)\r\n\r\ni'll create a pull request and will submit when this bug is fixed\r\n\r\nRegards\r\nAboo\r\n\r\n"}}
{"actor":{"display_login":"aboobolaky"}}