- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-06-2020 06:26 AM
Hi,
I am trying to get the time difference between the current time/Date and end_time (time/date) based on Time zone provided by the user in SCOPED application.
To achieve this I need to first get the current time/date in the time zone provided by the user. Please help me with this.
Thanks in Advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-06-2020 04:36 PM
Hi,
You would need to add a timezone offset to get the date time in a specific timezone.
This can be achieved in global scope using package calls or using setTZ method for a logged in users session object.
However, there is no api accessible in scoped apps. You may look at the moment.js opensource library.
//below piece of code will give you the timezone offset w.r.t UTC...
var tZSetOnVarOffSet = moment.tz(moment.utc(), tZSetOnVar).utcOffset();
//-- you can add the timezone offset to your current date time to fetch the date time in another timezone
I am adding the link of your previous question as well, as the solution for both are similar. You can follow the detailed script in the below question answer -
Regards,
Anirban
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-26-2021 08:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-24-2022 03:28 AM
Hello,
Do any one have any solution on this ??