How to retrieve the client's current time and time zone when using Shiny?

后端 未结 4 1017
伪装坚强ぢ
伪装坚强ぢ 2020-12-11 06:00

I\'m wondering if there is some clever way of getting the clients current time and time zone in order to use it in the server.R part of a Shiny application. If

4条回答
  •  被撕碎了的回忆
    2020-12-11 06:46

    You could fetch it over socket communication, but with much overhead, or if your time between the client is synchronized, you could trust your local time, fetch their timezone, evaluate the timezone difference between the server and the client, plus/minus the difference, then you would fetch their time and timezone without much work. (Somehow probably but in most case, by doing this, would lose a precision of 2 to 3 seconds due to computer keep up)

提交回复
热议问题