Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Weird Date Variable Value

Posted on 2004-10-15
2
Medium Priority
?
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 750 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

730 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