• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Date Math Question and Daylight Savings Time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date Math Question and Daylight Savings Time


  • Subject: Re: Date Math Question and Daylight Savings Time
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 20 Jan 2005 10:55:04 -0800

Well, it depends on how you look at it. My take is "working with Date/Time sucks in general and sucks deeply in Java". Time zone changes, which is what DST properly is, make it even worse. The root issue that we colloquially we think of a day as being from one morning to the next. Java is a bit more precise. A day is 24 hours of 60 minutes of 60 seconds of 1,000 milliseconds. Anything more or less is not a day. When you cross the DST boundary, a colloquial day is 23 or 25 hours. But not in Java. A day is 24 hours. Period. It is very precise and this precision can be very useful. It can also be a grand pain in the ass if you happen to be interested only in calendar days (but I only rented the car for 3 days, not four!). In that case you are pretty much stuck doing some dirty math in the backroom. Keeping time at noon avoids many of the problems as you move back and forth over the DST boundary.

Pierre Bernard has posted some code to the list in the past, but I don't see it in his very useful list of code snippets:
http://homepage.mac.com/I_love_my/code.html


Search the archives,  you are not alone.


Chuck


On Jan 20, 2005, at 10:20 AM, James Cicenia wrote:

Hello All -

I am doing some date math calculations and during daylight savings time my calculations seems to be off a day.

Any thoughts on why?

- James Cicenia

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
village.net


This email sent to email@hidden

--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Date Math Question and Daylight Savings Time
      • From: PA <email@hidden>
References: 
 >Date Math Question and Daylight Savings Time (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: Date Math Question and Daylight Savings Time
  • Next by Date: Re: Date Math Question and Daylight Savings Time
  • Previous by thread: Re: Date Math Question and Daylight Savings Time
  • Next by thread: Re: Date Math Question and Daylight Savings Time
  • Index(es):
    • Date
    • Thread