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.

version of a timezone?

timezone version
0
Posted

version of a timezone?

0

[*] No. The ID that you use to select a timezone with TimeZone.getTimeZone refers to a predefined timezone that contains daylight savings information (when applicable). For example, the following code selects the timezone used in New York, USA. // Get the North American Eastern Time definition. TimeZone theTz = TimeZone.getTimeZone( “EST” ); // get a really detailed date format and set it to the right timezone DateFormat df = DateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG ); df.setTimeZone( theTz ); // create a date in the locale’s calendar, set its timezone and hour. Calendar day = Calendar.getInstance(); day.setTimeZone( theTz ); day.set( 1998, Calendar.FEBRUARY, 1 ); day.set( Calendar.HOUR, 12 ); // print that date/time and // that date/time 150 full days of milliseconds later. System.out.println( df.format( day.getTime() ) ); System.out.println( df.format( new Date( day.getTime().getTime() + // get the millis 150L*24*60*60*1000L ) ) ); // add exactly 150 days of m

Related Questions

Thanksgiving questions

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