Solved

Weird Date Variable Value

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

829 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