Md. Minhajur Rahman wrote:The output of the following snippet is Wed Jan 13 00:00:00 BDT 2011. But why, please anyone help...
Well, that's hard to say, because you are using lenient mode -- and in that mode the class is allowed to do all sorts of things to avoid throwing an error. This is in addition to the processing of whether the year is two digits versus four digits, etc.
I can however, speculate. I think negative years are BC (before Christ) years. So the printout is actually for the year 2011 BC !! .... Now a little trivia. There is no such a thing as year zero. It goes from year 3 BC to year 2 BC to year 1 BC to year 1 AD to year 2 AD, etc. And since there is no such a thing as year zero, I am going to speculate that 0 maps to year 1 BC, -1 maps to year 2 BC, -2 maps to year 3 BC, etc.
Henry