Fetching Server Timezone

Forum to discuss the new web client version of Servoy.

Fetching Server Timezone

Postby dev-ws-011 » Thu Jul 08, 2021 4:12 pm

Hi All,

Consider we have server in different timezone and client in different timezone and we need to format the date using server timezone.

Code: Select all
utils.dateFormat(date, format, Servertimezone)


I have searched documentation to get Server Timezone but no results. It might be possible that I have missed this while searching.

Any help will be highly appreciated.

Thanks
Servoy Developer
dev-ws-011
 
Posts: 66
Joined: Fri Oct 21, 2016 8:23 am

Re: Fetching Server Timezone

Postby rph » Tue Jul 13, 2021 10:07 am

Try:

Code: Select all
var serverTimeZone = java.util.TimeZone.getDefault();
...


Java-Code will be executed on the Server (at least with NG, not sure in SmartClient). This way you should get the timezone of your server where your client is running on.

Regards
Roland
rph
 
Posts: 46
Joined: Wed Aug 10, 2011 11:44 am
Location: Cham, Switzerland


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests