on 02-27-2015 1:49 PM
Hi experts,
we need to comunicate a specific date & time to multiple users by email directly from HCP backend.
Date and time is stored in UTC on HCP side, but of course it would be much more conveniant for the mail recipients to see the times directly in their local time format, like for us in Germany UTC+1.
Any thoughts on how to achieve this?
Regards, Steffen
Dont really understand the problem. javascript Date obejct has timezone adjustment.
If you know your users timzone you can do something like
new Date(date.getTime() + new Date().getTimezoneOffset()*60*1000);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunatelly i dont have such example.
If the mail body has javascript (and it is allowed to execute it), javascript date object should work fine and no extra calculation is needed, UTC time will be converted to proper local time. I ususally do someting like this
eval('new ' + datestr.replace(/\//g, ''))
where datestr is OData formatted date property ( "/Date(694224000000)/"
)
If the dates are stored on HCP, and the users (and their timezones) too, then why not use the power of HCP (Java) to get a personalized date?
api - Java: How do you convert a UTC timestamp to local time? - Stack Overflow
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.