Post Reply 
epoch Prime
01-06-2018, 08:26 PM
Post: #34
RE: epoch Prime
(01-06-2018 06:26 PM)Dieter Wrote:  
(01-06-2018 02:45 PM)salvomic Wrote:  nobody fo you said me that I made an "old error of mine": to use 84600 instead of 86400!
I made this error in some astronomical programs and then I was aware of the bug after ...days... :-(

What? Nobody told you? Sure I did! Didn't you read my post?

(01-06-2018 09:41 AM)Dieter Wrote:  It's not a timezone problem. Take a closer look at the quoted code line. ;-)

"Take a closer look at the quoted code line" – wasn't this clear enough?

(01-06-2018 02:45 PM)salvomic Wrote:  Again, it would be better to have optional input, instead of remembering to put some "magic numbers" as -1 ...

I think it's better that the timezone is not optional but required. And this "magic" number is not that magic – it's simply your local timezone. We can safely assume that virtually everyone who uses such a program for converting date and time is aware of his local timezone.

Dieter

I would not be so confident that people know there own timezone...
I know what it is right now, yes, but at some times of the year I wouldn't be sure what it would be next week. Have the clocks gone +1 or -1? Is that this weekend or next that daylight is saved? It might have saved daylight, but on at least one occasion it cost me breakfast Smile
And summertime in Europe happens/used to happen/ on a different weekend than in the uk, so if you travel 40 km on the wrong week the time difference can jump between 0-2 hours.

That issue with the wrong constant reminds me of a time I was debugging some astronomical code that seemed to show that it took light 9 minutes to reach us, rather than the expected 8.
I was beginning to suspect an error in my constants.
I rigorously checked the degrees/radians conversion factor at least twenty times, and every decimal digit was correct. Eventually I realized it was a non-decimal digit that was wrong: 157.xxx instead of 57.xxx

It is so easy to read what you expect to see.

Surely it is time that technology only allowed constants to be copied, rather than typed in??? Wink

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
epoch Prime - salvomic - 01-05-2018, 05:00 PM
RE: epoch Prime - pier4r - 01-05-2018, 06:03 PM
RE: epoch Prime - Dieter - 01-05-2018, 07:30 PM
RE: epoch Prime - salvomic - 01-05-2018, 07:42 PM
RE: epoch Prime - Dieter - 01-05-2018, 07:51 PM
RE: epoch Prime - salvomic - 01-05-2018, 08:07 PM
RE: epoch Prime - Dieter - 01-05-2018, 08:47 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:10 PM
RE: epoch Prime - Dieter - 01-05-2018, 09:27 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:36 PM
RE: epoch Prime - Dieter - 01-05-2018, 10:07 PM
RE: epoch Prime - salvomic - 01-05-2018, 10:16 PM
RE: epoch Prime - Dieter - 01-05-2018, 10:48 PM
RE: epoch Prime - pier4r - 01-05-2018, 09:40 PM
RE: epoch Prime - salvomic - 01-05-2018, 09:44 PM
RE: epoch Prime - Dieter - 01-05-2018, 09:56 PM
RE: epoch Prime - salvomic - 01-05-2018, 06:17 PM
RE: epoch Prime - salvomic - 01-05-2018, 11:26 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:53 AM
RE: epoch Prime - salvomic - 01-06-2018, 09:28 AM
RE: epoch Prime - Dieter - 01-06-2018, 09:41 AM
RE: epoch Prime - Didier Lachieze - 01-06-2018, 09:50 AM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 09:40 AM
RE: epoch Prime - pier4r - 01-06-2018, 10:46 AM
RE: epoch Prime - Dieter - 01-06-2018, 12:42 PM
RE: epoch Prime - salvomic - 01-06-2018, 01:07 PM
RE: epoch Prime - salvomic - 01-06-2018, 02:45 PM
RE: epoch Prime - Dieter - 01-06-2018, 06:26 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018 08:26 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:37 PM
RE: epoch Prime - pier4r - 01-06-2018, 09:59 PM
RE: epoch Prime - salvomic - 01-06-2018, 10:07 PM
RE: epoch Prime - pier4r - 01-06-2018, 10:55 PM
RE: epoch Prime - pier4r - 01-06-2018, 03:28 PM
RE: epoch Prime - salvomic - 01-06-2018, 03:45 PM
RE: epoch Prime - salvomic - 01-06-2018, 04:10 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 06:54 PM
RE: epoch Prime - salvomic - 01-06-2018, 07:58 PM
RE: epoch Prime - salvomic - 01-06-2018, 08:45 PM
RE: epoch Prime - Dieter - 01-06-2018, 08:59 PM
RE: epoch Prime - salvomic - 01-06-2018, 09:01 PM
RE: epoch Prime - Dieter - 01-06-2018, 11:07 PM
RE: epoch Prime - StephenG1CMZ - 01-06-2018, 11:24 PM
RE: epoch Prime - salvomic - 01-07-2018, 09:26 AM
RE: epoch Prime - Dieter - 01-07-2018, 06:22 PM
RE: epoch Prime - salvomic - 01-07-2018, 06:28 PM



User(s) browsing this thread: 1 Guest(s)