cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Get the Time Zone for Extended UI

jw614h
1-Newbie

Get the Time Zone for Extended UI

Does anyone know how I can send the timezone for the user to a custom object?

I need the part in red:

SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a z");

formatter.setTimeZone(TimeZone.getTimeZone("America/New_York"));

Thanks

Jay

2 REPLIES 2
cdovholuk
6-Contributor
(To:jw614h)

I assume you're talking javascript from a browser pushed up to Scripto. I'm not javascript expert but there really doesn't seem to be a good way to do that.

You can get the timezone offset from javascript but that works in hours offset from GMT so it's not perfect. If the user is a user on our platform - you could find the user in the custom object and get the timzeone preference they have set in the platform maybe?


userBridge.find("clint").timezoneId


hope that helps...     

that should work,

Thanks

Jay

Top Tags