botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Enhance Activity schema to include client's timezone

Open will-molloy opened this issue 6 years ago • 1 comments

Is your feature request related to a problem? Please describe.

  • We have users in different timezones, so it would be useful to retrieve the client's timezone from the activity schema.

Describe the solution you'd like

  • For activity schema to include a LocalDateTime or TimeZone property.

Describe alternatives you've considered

  • I tried deriving the timezone from the localTimestamp field, however, since it is a DateTime object is does not include timezone information.
  • Suggest:
    • Changing localTimestamp field to LocalDateTime type
    • OR include a TimeZone type in the Activity schema

Additional context

  • The JSON payload localTimestamp field does include the timezone, but when deserialised into Java it is lost, so it stores the same value as timestamp:

JSON payload field (in bot emulator): Screen Shot 2019-04-29 at 1 11 04 PM

Java field (in IntelliJ debugger): Screen Shot 2019-04-29 at 1 09 55 PM

[enhancement]

will-molloy avatar Apr 29 '19 01:04 will-molloy

Looks like DateTime does encode TimeZone, LocalDateTime does not (my bad). Need to call DateTime#getZone() method.

But still, my local time zone of UTC+12 is converted to UTC when deserialised into Java ?

will-molloy avatar May 06 '19 04:05 will-molloy