Hi everyone,
I am working on a reactive application in OutSystems, specifically a booking system where users need to sign up for a slot before 10:30 AM (my time zone, Italy) on the same day. The challenge I'm facing is how to consistently check user’s time against my cut-off time.
Details:
Current Implementation:
Questions:
Ideally, I would like to convert the server time to Italy’s time zone time in a server action (it should automatically handle daylight saving), then compare it against 10:30 AM and make the necessary adjustments based on that.
I would appreciate any guidance, sample code, or references to relevant documentation that could help solve this issue efficiently.
Thank you in advance for your help!
@Andrea Caselli
Approach
Steps to Implement
1. Get the Current Server Time in UTC
Use the CurrDateTime() function to get the current server time in UTC.
2. Convert UTC to Italy Time
You can use a custom function to handle the conversion, considering DST changes. This involves using standard library functions to determine if DST is currently in effect in Italy and adjusting the time accordingly.
3. Compare Against 10:30 AM Italy Time
After converting the time, compare it to 10:30 AM Italy time.
Hi @Manikandan Sambasivam ,
Thank you for your detailed response.
I would consider this as my plan B and expected that there would be an easier/already made solution. The custom function will have to calculate the current local time based on the date and then compare it.
If anyone knows of a more straightforward or built-in way to handle this in OutSystems, especially regarding automatic DST adjustments, please let me know. Any additional insights or examples would be greatly appreciated.
Thanks again!
Andrea
Hi, i search this, but whether it is helpful or not:
https://stackoverflow.com/questions/1627668/how-to-preserve-accurate-time-daylight-saving-for-a-web-application
regards
Hi Andrea Caselli,
We had similar requirement to have DST time on server side for validations.
So I have developed a .NET extension to pass the timezone code and date time as input parameter to this .NET extension,
then I have added logic to fetch correct DST time for the UTC.
Hence UTC to Destination Timezone and destination to UTC conversions are handled.
I will add more details here, Since this is an OLD post.
For client side we have used javascript to do the same.
https://www.outsystems.com/forums/discussion/102380/how-we-can-handle-time-zones-and-daylight-saving-time/