Solved

Weird Date Variable Value

Posted on 2004-10-15
2
196 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2003, my txt file export is running backwards 4 47
Problem to skip loop 6 55
How to hault or freeze parent form when a 2d form is open in vb6 3 36
MsgBox 4 48
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now