Re: Julian Day Question [message #48868 is a reply to message #48867] |
Fri, 26 May 2006 10:05   |
news.qwest.net
Messages: 137 Registered: September 2005
|
Senior Member |
|
|
"Paul Van Delst" <Paul.vanDelst@noaa.gov> wrote in message
news:e57e90$6ri$1@news.nems.noaa.gov...
> Why does providing the ",0,0,0" hh,mm,ss data cause the start reference to
> suddenly shift by 12 hours?
Yes, that is exactly the problem. The function breaks one of the fundamental
tenets of software programming. It does 2 different things (depending on
the input).
1) convert to julian day (noon based)
2) (a) convert to julian day and (b) convert to midnight based
Hence my suggestion to hardwire the function to always perform one function.
I propose that always inputting the h:m:s and forcing the result to return
the midnight
based julian day, which is what i do in my little library of time functions.
Cheers,
bob
PS I should admit that I almost always break this tenet of programming.
I write routines that are overloaded to "do what you want it to" :O
But then again, I am a hack :)
|
|
|