Child pages
  • Internationalization - I18N

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are four levels of setting the locale format:

  1. Java Virtual Machine (JVM) level - setting the locale...............................
  2. Servoy Application Server level - setting the Locale Settings on the

...

  1. Servoy Server Home page; the formats set will be applied to all fields that do not have a format set at table or field level.
    2.1. The Smart Client's locale formats can be also set via Edit > Preferences > Locale; the formats set in this way will be applied on top of the Admin Page settings.
  2.  table level - setting the Default format under Details tab on a column, in the Table Editor; the format set will be applied to all fields having the column as data provider, that do not have a format set on field level.
  3. field level - setting the format property of a field in Properties view.

Timezones

In JavaScript (and Java), dates are always timestamps with the number of milliseconds which have passed since January 1st 1970 in UTC. Only when a date is displayed or converted to a string, the conversion to a certain timezone is done.

Example
If one calls application.getTimeStamp() at 8pm in Colombo, Sri Lanka and at 8pm in LA, California USA, two different timestamp values will be received. On the other hand, if two developers, one located in LA and one in Colombo would execute the code at exactly the same time, they would get exactly the same timestamp value, regardless of the timezone they are in.

The Servoy Application Server can be forced to run in a certain timezone, by including the following JVM argument in command line:

Code Block
-Duser.timezone=US/Eastern

A complete table with the supported values of the timezone property can be found on IBM's WebSphere Application Server page.

Servoy has 2 modes for working with Timezones. Switching between these two modes can be done by toggling the servoy.use.client.timezone property on the Servoy Application Server's Servoy Server Home page, under Locale Settings.

Property set to true:

A datetime entered will be presented exactly the same in each client, regardless of the timezone of the client

Example: Any client, regardless of which timezone they are in, sees a datetime entered as 8pm as 8pm. Servoy makes corrections under the hood to achieve this.

Property set to false:

Servoy performs no calculation and the dates are automatically converted by Java to match the user's timezone.

Example: A client in UTC + 5 enters 10pm. The server runs in UTC, so stores 5pm. And a client in UTC - 2 sees 3pm. Since databases do not store a timezone with a date, everything will be mixed up when the database is started in another timezone.

The first scenario (having client timezone property set to true) is the preferred way of operating, because this gives the most consistent outcome.