473,549 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I don't think GregorianCalend ar.setChangeDat e works

1 New Member
I see the expected 11 day gap for the default ChangeDate but when I change it to the English change date, I don't see the expected 12 day gap. Any advice?
Expand|Select|Wrap|Line Numbers
  1. import java.text.DateFormat;
  2. import java.util.*;
  3. public class SetGregorianChangeDate {
  4.  
  5.     /**
  6.      * @param args
  7.      */
  8.     public static void main(String[] args) {
  9.         DateFormat df = DateFormat.getDateInstance();
  10.         df.setTimeZone(TimeZone.getTimeZone("GMT"));
  11.  
  12.         GregorianCalendar  gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
  13.         System.out.println("Get default change date in GMT:" 
  14.           + df.format(gc.getGregorianChange().getTime()));        
  15.         System.out.println("Get day before default change date in GMT (Expect 11 day gap Oct 4, 1582):" 
  16.           + df.format(gc.getGregorianChange().getTime() - 24*60*60*1000));
  17.  
  18.         gc = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
  19.         gc.set(1752, 9 - 1 , 14, 0, 0, 0);
  20.         gc.setGregorianChange(gc.getTime()) ;
  21.  
  22.         System.out.println("Get new change date in GMT:" 
  23.           + df.format(gc.getGregorianChange()));        
  24.         System.out.println("Get new day before default change date in GMT (Expect 12 day gap Sep 2, 1752) :" 
  25.           + df.format(gc.getGregorianChange().getTime() - 24*60*60*1000));
  26.     }
  27. }
Get default change date in GMT:Oct 15, 1582
Get day before default change date in GMT (Expect 11 day gap Oct 4, 1582):Oct 4, 1582
Get new change date in GMT:Sep 14, 1752
Get new day before default change date in GMT (Expect 12 day gap Sep 2, 1752) :Sep 13, 1752
Jun 28 '11 #1
0 1625

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2469
by: Ryan R. Rosario | last post by:
Hi - **I apologize for posting this again. I dont think my first one went thru** I am in the process of converting a table based website over to a CSS based website and I am having a problem. The website "template" consists of 3 regions: header, sidebar and content. Header spans horizontally across the screen at the top of the
3
1211
by: Guhanath | last post by:
Dear All, Is dot.Net Framework processor based and mainly targetted at Pentium machines??Will it work in AMD Processor especially AMD Athlon 64 Processors. -- Guhan
0
1074
by: Rahmi Acar | last post by:
http://finalgate.ath.cx it got a simple search engine and you might try it out search for syntax description based on i.e. int, else, if, do and so on it will then return to a page containing a code example or a description for the purpose of any kind of syntax. This is all just an indexed version of www.mindview.net's C++ books volume 1 and...
19
2884
by: Wouter | last post by:
Hi, I try to make when i send a <form> that he dont open a new window. Is there someone who know how i can make this whit javascript ? Greets Wouter
0
949
by: richard | last post by:
Try using windows terminal service
10
2001
by: free2cric | last post by:
Hi, FOllowing is a program which is written by someone else. Its output is a wonderful poem. I dont understand how it works really. can anyone tell. thanks cric #include <stdio.h> main(int t,char _,char *a) {
24
7631
by: Jazper | last post by:
hi i have this problem. i made a class deverted by CRootItem with implementation of IDisposable-Interface. i made a test-funktion to test my Dispose-Method.... but when set a breakpoint in my Dispose-Method and call the GC nothing happend!!! my Disposemethod has never been called!! so the GC dont call my Dispose-Method although I...
1
1761
by: rcamarda | last post by:
I was looking through our vendors views, searching for something I needed for our Datawarehouse and I came across something I do not understand: I found a view that lists data when I use it in t-sql, however when I try to use the statement when I modified the view (via MS SQL Server Management Studio) I can not execute the statement. I get ...
19
2230
by: so many sites so little time | last post by:
the table is head the colunm is called body <?php //show_site.php // This script retrieves blog entries from the database. // Address error handing. ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); // Connect and select.
4
1471
by: piercy | last post by:
Ive been developing a program for a while nwo and am wanting to release the version ive been working on. now before i do i need to test on a few other machines than my own. So at my work we have a pc with vmwar eon thats helpful for testing. so i ran it in release mode and then went and copied the needed files into another folder and...
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7967
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5377
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.