realbasic-nug
[Top] [All Lists]

Dates before Jan 1, 1904

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Dates before Jan 1, 1904
From: Roger Carey <rogercarey at mac dot com>
Date: Sat, 1 Jun 2002 10:06:51 -0400
Using RB 4.0.2:
If using ParseDate("7/4/1776",d)
d.TotalSeconds = 18446744065391368192 (using format (d.totalseconds, "#.0;-#.0"))

Then the d.shortdate + " " + d.longtime is 07/03/1776 11:57:51 PM

The TotalSeconds is a double. It is more digits (20) than a double can handle (16+?). I think this accounts for the difference between 07/03/1776 11:57:51 PM and 7/4/1776 12:00:00 AM.

It looks like they are using an integer for total seconds in the Date class, but forgetting about the negative bit for the total seconds property when changing it to a Double.

Anyone know of a workaround?

Thanks,

Roger Carey





<Prev in Thread] Current Thread [Next in Thread>