can anyone tell me which nlapi command to use to get the user's timezone from server.
I have tried
nlapiStringToDate( nlapiDateToString(new Date() , 'datetimetz'),'(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna') but I am not able to get the actual time of the selected timezone
n
Nik
01/03/2019, 11:19 AM
Don't know your use case or even what you are trying to do
Old School Vanilla new Date() should give you the user Date and Time in the Client script. But it will give you the Server TimeZone in server-side script,
Nik
01/03/2019, 11:19 AM
If you already know the timezone of the user and want to exploit that and get the Date and time of that timezone, there are a number of ways
m
Mitesh
01/03/2019, 12:12 PM
@Nik could you share atleast a way where I can get the date and time of the selected dealer because I have the timezone with me
n
Nik
01/03/2019, 12:13 PM
In what format do you have timezone?
Nik
01/03/2019, 12:14 PM
Btw, thi will not include any API, should be js or a a js library function
m
Mitesh
01/03/2019, 12:48 PM
I have the ids of the timezone record
n
Nik
01/03/2019, 12:56 PM
Do you have offsets? Like for Pacific, it should be +8 or + 7 depending upon daylight savings or standard or do you have the INTL/IANA format like "America/New_york"
Nik
01/03/2019, 1:04 PM
I think you may want to go for moment.js/moment-timezone.js and handle the conversions. Worth a shot. Have look at their documentation and that will get you started.
There are some cool questions related to moment.js on stackoverflow which may be of help to you. I did check them out initially when I started. Might give you a boost.