Solved

Weird Date Variable Value

Posted on 2004-10-15
2
198 Views
Last Modified: 2010-05-02
Hi,

I have a client that is using Windows XP Home to run our VB6 application. The VB6 app has a constant declared:

Global Const gcDemoExpire As Date = Empty

On this clients computer I've put a message box to display the value of gcDemoExpire and its value is 12am. This is not the case on any of our development computers (where the value is 00:00:00), nor any other client computers that I'm aware of.

Anyone have any ideas why a date type constant defined as Empty has a non zero value?

TIA.

Mark.
0
Comment
Question by:Griff000
2 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 250 total points
ID: 12317892
Both 00:00:00 and 12AM are 0 values.

The problem is that the client's computer's system locale is interpreting times in a short form (I'll bet the clock in the taskbar shows a similar time format).

Use MsgBox Format(myDate, "hh:mm:ss") to display it correctly.

HTH

J.
0
 

Author Comment

by:Griff000
ID: 12320942
Thanks jimbobmcgee.

It's not that I didn't know how to format it, it's that I'd expected an 'Empty' date to equal zero under any conditions... you live and learn.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question