Please explain.Campbell Ritchie wrote:...but you may find you can only go to the correct century end (31-dec-2100).
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:imagine we started over with the calendar. Today would be Jan 1st, year...1. the number tells you what year you are IN, not how many years have gone PAST.
So on Jan 1st of the year 100, you've only been through 99 years...you still have a full year to go. Now just carry that forward, and you'll see why the end of the 21st century will be on Dec 31, 2100.
All human counting is 1‑based, isn't it?Stephan van Hulst wrote:Counting years is 1-based. . . .
You aren't going to believe this, but I don't remember the 19th century. But people probably knew that it ended with a year starting 19. That was the only year in the 19th century with 19 in. 2000 was the only year in the 20th century with 20 in.Asher Max Schweigart wrote:. . . but in most people's mind, a millennium/century/decade starts on the year that ends with 0. . . .
Not quite the right question. We are looking at code. Consider asking,do you need the mathmatically/historically correct last day of the century, or do you need what most people would call the last day of the century?
Campbell Ritchie wrote:
All human counting is 1‑based, isn't it?Stephan van Hulst wrote:Counting years is 1-based. . . .
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
That is an exception. But most parents say they have a six‑hour‑old baby, or a six‑day‑old baby, or a six‑week‑old baby, or a six‑month‑old baby.fred rosenberger wrote:. . . you are zero years old until you reach your first birthday . . .
narendra enamala wrote:I want I want to get either last day of the century or I need 1000 years later like 31-dec-2999
Campbell Ritchie wrote:You aren't going to believe this, but I don't remember the 19th century. But people probably knew that it ended with a year starting 19. That was the only year in the 19th century with 19 in. 2000 was the only year in the 20th century with 20 in.