Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I create the BST timezone specifically?

BST create timezone
0
Posted

How do I create the BST timezone specifically?

0

• A. First, note the pitfall that as well as being the Bangkok Standard Time timezone 6 hours east of GMT, “BST” also means “British Summer Time”. In most or all other timezones, daylight saving time is handled automatically and internally. But GMT is the reference for all other timezones, and so does not have the summertime update applied automatically. So here is the code to create a British Summer Time timezone that is offset 1 hour from GMT between two dates: import java.util.*; import java.text.*; // BST runs from last Sun in March to 4th (not last) Sun in Oct // create a BST timezone (code courtesy of Tony Dahlman). SimpleTimeZone bst_tz = new SimpleTimeZone( 0, // no offset from GMT “BST”, // individualized tz id Calendar.MARCH, -1, Calendar.SUNDAY,2*60*60*1000, // first Sun Apr 2AM Calendar.OCTOBER, 4, Calendar.SUNDAY,2*60*60*1000 // 4th Sun Oct 2AM ); // set the BST timezone as the default SimpleTimeZone.setDefault(bst_tz); // apply that TimeZone to create a Calendar object li

0

You can create an arbitrary TimeZone object with the code below. In most or all other timezones, daylight savings time is handled automatically and internally. But GMT is the reference for all other timezones, and so does not have the summertime update applied automatically.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123