Home > Notes & XPages > XPages: Timezones and daylight saving time

XPages: Timezones and daylight saving time

Just one more:

Via serverside Javascript you can display the timezone quite easy. You can do this with this command:

context.getTimeZone().getDisplayName();

If you live in Germany, like me, or have to develop an application for german users, you will know the true promise of daylight saving time.

I have used the function and everything worked out fine, until the time switch came and my timezones weren’t displayed properly (CEST instead of CET)

The solution is easy. There is a parameter, which controls whether we have daylight saving time, or not. It is the first one of the function (which I must have overlooked in the beginning). True means we have daylight saving time, false means we haven’t.

But how can we check whether we have DST or not? There is a function with the name isDST() within the NotesDateTime object. It returns a boolean value, which you can use with the function.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: