Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. The Class Library, Part 1 > Under the Microscope Ancient Days

Under the Microscope Ancient Days

image

The ability to store dates across a span of almost 10,000 years should protect us from the possibility of future “Millennium bugs”, but because the earliest possible date is January 1, 0001, you’ll run into problems if you’re dealing with historical data, (“historical” in the real-world sense, not the computer sense of “anything before today”). You can’t record the date of the Battle of Thermopylae (353 BCE) or the beginning of the Roman Republic (509 BCE) using normal techniques.

It’s not an issue very often. (In my entire career, I’ve had to deal with the problem just once.) But you should be aware of the issues. One alternative is to include the appropriate date field (almost certainly a DateTime) as a property of a new class that also exposes an Era property and create methods that accommodate eras. (If you’re interested, why don’t you try doing it?)


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint