Title: Timezone problem on getAttendeesAvailability CalendarEvent · Issue #88 · OfficeDev/ews-java-api · GitHub
Open Graph Title: Timezone problem on getAttendeesAvailability CalendarEvent · Issue #88 · OfficeDev/ews-java-api
X Title: Timezone problem on getAttendeesAvailability CalendarEvent · Issue #88 · OfficeDev/ews-java-api
Description: When retrieving FreeBusy data using ExchangeService.getUserAvailability() the StartTime and EndTime of each CalendarEvent in the results are returned as UTC values even if the ExchangeService was constructed with a specific TimeZone. The...
Open Graph Description: When retrieving FreeBusy data using ExchangeService.getUserAvailability() the StartTime and EndTime of each CalendarEvent in the results are returned as UTC values even if the ExchangeService was c...
X Description: When retrieving FreeBusy data using ExchangeService.getUserAvailability() the StartTime and EndTime of each CalendarEvent in the results are returned as UTC values even if the ExchangeService was c...
Opengraph URL: https://github.com/OfficeDev/ews-java-api/issues/88
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Timezone problem on getAttendeesAvailability CalendarEvent","articleBody":"When retrieving FreeBusy data using ExchangeService.getUserAvailability() the StartTime and EndTime of each CalendarEvent in the results are returned as UTC values even if the ExchangeService was constructed with a specific TimeZone.\n\nThe method readElementValueAsUnbiasedDateTimeScopedToServiceTimeZone() of EwsServiceXmlReader is used to convert these UTC strings to Date objects, \nhowever at some point the DateFormat has had its TimeZone set to the default by commenting out line 108. (_formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));_)\n\nThis causes the UTC string to be parsed as a local Date. so in the UK during British Summer Time the String \"2014-10-06T12:00:00\" becomes the Date 2014-10-06T12:00:00+0100 which is 2014-10-06T11:00:00Z i.e. one hour out.\nfor dates in standard time there is no problem in the UK as UTC == GMT so the conversion has no effect.\n\nremoving the comment on line 108 (and I suggest 114) solves the problem in that the Date returned is in UTC and can be converted to local time as required. So \"2014-10-06T12:00:00\" becomes the Date 2014-10-06T12:00:00Z which is 2014-10-06T13:00:00+0100 \n\nMy suggested fix is as follows:\n\n```\npublic Date readElementValueAsUnbiasedDateTimeScopedToServiceTimeZone()\n throws Exception {\n // Convert the element's value to a DateTime with no adjustment.\n String date = this.readElementValue();\n Date tempDate = null;\n try {\n DateFormat formatter = \n new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n tempDate = formatter.parse(date);\n } catch (Exception e) {\n DateFormat formatter = new SimpleDateFormat(\n \"yyyy-MM-dd'T'HH:mm:ss.SSS\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n tempDate = formatter.parse(date);\n }\n return tempDate;\n}\n```\n\nHowever, it may be worth reviewing the code to make use of either the ExchangeService TimeZone or the WorkingHours TimeZone from the response\n","author":{"url":"https://github.com/dave-stanley","@type":"Person","name":"dave-stanley"},"datePublished":"2014-10-08T14:42:40Z","url":"https://github.com/OfficeDev/ews-java-api/issues/88"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d74e4fc3-1a0f-10b4-64a0-e8a75438e7d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEF2:37323C:366BD8:4D2A49:6B05B6E1 |
| html-safe-nonce | 89ecc59454fdb3b8d65d8bdc4cfb1619f1c54eacdf84565db5a6e9130db304c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUYyOjM3MzIzQzozNjZCRDg6NEQyQTQ5OjZCMDVCNkUxIiwidmlzaXRvcl9pZCI6Ijc0NjU5NTA1MTcyNDQ4MzU1NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0c6560a3c27b8a53fbc26eec06c22495153fb62ad66384a7ed63ea119a8ca6e5 |
| hovercard-subject-tag | issue:45252194 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/OfficeDev/ews-java-api/88/issue_layout |
| twitter:image | https://opengraph.githubassets.com/41a3021a36a1afc6a41337cfb6256ee64e4bee3e5dd4541aef06cc176b47ea5f/OfficeDev/ews-java-api/issues/88 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/41a3021a36a1afc6a41337cfb6256ee64e4bee3e5dd4541aef06cc176b47ea5f/OfficeDev/ews-java-api/issues/88 |
| og:image:alt | When retrieving FreeBusy data using ExchangeService.getUserAvailability() the StartTime and EndTime of each CalendarEvent in the results are returned as UTC values even if the ExchangeService was c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dave-stanley |
| hostname | github.com |
| expected-hostname | github.com |
| None | 106bb568ff143beb0075344f71b9097568f02130f2e85ac7ca2a4b82efb00b47 |
| turbo-cache-control | no-preview |
| go-import | github.com/OfficeDev/ews-java-api git https://github.com/OfficeDev/ews-java-api.git |
| octolytics-dimension-user_id | 6789362 |
| octolytics-dimension-user_login | OfficeDev |
| octolytics-dimension-repository_id | 23322482 |
| octolytics-dimension-repository_nwo | OfficeDev/ews-java-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 23322482 |
| octolytics-dimension-repository_network_root_nwo | OfficeDev/ews-java-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b207ef4132553ef1428fae8ca470a518d651ce07 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width