🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #407

Re: VB3 & VB4 16-bit Year 2000 Compliance Query

#407
From: Bart Lateur
Date: Thu, 16 Apr 1998 00:00
24 lines
1709 bytes
Tim Foster wrote:

>After some testing in a VB4 16-bit application, I'm fairly positive there
>is a problem reading dates into Variants (VB seems to be trimming the dates
>to Short Format), and so when the Year 2000 rollover occurs, the dates take
>on '20' as the century value if you read values back from the Variant.

I think you worry too much.

What you are looking at is the PRINTOUT FORMAT of the date, not the
actual date itself. Try using Format$() to get proper 4-digit years.

Internally, VB stores dates as day numbers (since 1900 or something),
with fractional parts for hours/minutes/seconds. One hour is 1/24
(~0.04167). See VB help, DateSerial(), for some more info. Just for fun,
try printing the result of applying CDbl() on a date.

As long as no part of your program actually depends on the date as a
string, with the year in two digits, you should be pretty safe. I just
hope the Access stores the dates properly.

HTH,
Bart.
Technical Details
Message-ID: <35390950.2159925@news.tornado.be>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bfa79b$a1ea0060$03ef98c3@novix>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108062,cf6962aa78a8c295
X-Google-Attributes: gid108062,public
X-Google-Thread: f7a67,cf6962aa78a8c295
X-Google-Attributes: gidf7a67,public
X-Google-Thread: 110e3b,cf6962aa78a8c295
X-Google-Attributes: gid110e3b,public
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: VB3 & VB4 16-bit Year 2000 Compliance Query
Date: 1998/04/16
Message-ID: <35390950.2159925@news.tornado.be>
X-Deja-AN: 344679069
Content-Transfer-Encoding: 7bit
References: <01bfa79b$a1ea0060$03ef98c3@novix>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Organization: MediaMind
Newsgroups: comp.lang.basic.visual.misc,cz.comp.lang.basic.visual,microsoft.public.vb.bugs