Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Ricardo Sousa
5
Views
6
Comments
Application used in different timezones
Question
Timezone
Hi!
I'm having a problem that I'm sure that most of you already faced it so I would love to know how you solved it.
Actors
Bill - User in California - USA (current time: 06:00:00)
Manuel - User in Lisbon - Portugal (current time: 14:00:00)
Story
Bill and Manuel check, at the same time, a WebScreen with the following information:
Project: Sardines Light
Creation: 06:00 (just now)
At this point Bill is happy as he now knows that a project about its favorite meal was just created but Manuel is lost as he starts thinking that the current time is 6:00 and that he shouldn't be at work.
So, what to do?
Best,
Ricardo Sousa
Justin James
MVP
Ricardo -
There is a Timezone extension/component out there with a list of Timezones and the ability to convert times. We have a UserExtended entity for each user, and one of the attributes for the users in there is their timezone. We made a couple of simple helper Actions which easily convert between the server's time zone and the user's time zone.
J.Ja
1 reply
14 Aug 2013
Show thread
Hide thread
rajni gora
Justin James
wrote:
Ricardo -
There is a Timezone extension/component out there with a list of Timezones and the ability to convert times. We have a UserExtended entity for each user, and one of the attributes for the users in there is their timezone. We made a couple of simple helper Actions which easily convert between the server's time zone and the user's time zone.
J.Ja
Hi Justin,
This components works ver well, but what if the application is used in more than two timezones and each time actions change according to current time in that timezone. I wanted to know is there a way application can get the local time without being hardcoded it to a particular timezone. Is there a way to get current time or timezone from javascript file to outsystem application. As I tried but not able to pass data from javascript to outsystem application. Let me know if you can help in regard to this.
Thanks,
?Rajni
Hari
Hi Justin,
I couldnt find this extension in outsystems 8. Should i download it seperately whether it works for java as well ?
Justin James
MVP
Hari -
It needs to be downloaded from the Forge. I do not know if it works for Java. Most of the hard work is in the static entities which will work with Java, even if the extension is .NET only,it's just converting the times, you should be able to look at the .NET code and easily replicate it in Java. I would almost expect to be able to copy/paste the C# to a Java extension and have it work right, since they are both so similar with basic stuff like time handling.
J.Ja
Justin James
MVP
Rajni -
I suppose you could pass over the user's time zone every time. I don't know the JS function for getting it. It won't be reliable though, and will be potentially confusing if they are accessing it from a mobile device that updates the time zone as they travel.
A MUCH better way, though, would be to have each user have a timezone setting that they can control from "My Info", and when the user is created it, get the time zone through JS and default the setting to that value. This way, they control the time zone, and you don't need to pass the zone around with every request.
Easy enough to pass the data, just have a hidden input field on the screen and use JS to set it's value. Do some quick searches on here to get examples of how to write JS that interacts w/OS widgets.
J.Ja
Joop Stringer
Here's a little javascript to detect the users timezone
https://pellepim.bitbucket.org/jstz/
I would save all times in GMT time in the database and use a script or query to show it in the users timezone
You might have a look here as well
https://forum.jquery.com/topic/timezone-with-jquery
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...