Solved

Weird Date Variable Value

Posted on 2004-10-15
2
195 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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 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

11 Experts available now in Live!

Get 1:1 Help Now