Forum Discussion

miles's avatar
miles
Director
7 years ago

Getting local time from client for a welcome message

We are looking to build a custom component in our community that uses the users system time or timezone to display a customised message.

eg if it is morning for the user based on their system time we'd display 'Good Morning'. Since our Community is often visited by people not in the same country, we want to take the time from the users system, rather than local time for our community. 

Does anyone have any tips on doing this as currently we aren't sure how to get the client time?

 

  • I would say your best shot is JavaScript that runs in the browser (client) of your user and is therefore the most reliable source we have to determine the users local time.

  • I would say your best shot is JavaScript that runs in the browser (client) of your user and is therefore the most reliable source we have to determine the users local time.