Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date to Value?

Status
Not open for further replies.

Kicket

Technical User
Jun 15, 2002
155
US
i m using vb6, what's the function will change a date stored in a string to a value?

for example, i have a date 12/12/2001 2:00:00 PM and i want change it to a value 47323.33513 what functiion should i use?

my idea is after convert it, i can compare the date,see which one is a later date. Or is there a easier way?

ff
 
MSDN says:

DateValue(date)

Returns a Variant (Date).

[tt]The required 'date' argument is normally a string expression representing a date from January 1, 100 through December 31, 9999. However, date can also be any expression that can represent a date, a time, or both a date and time, in that range.[/tt]

BUT...
It says nothing about time part :) it just skips it). So probably you'll have to use

TimeValue(time)

function as well.
 
In vb6 you can just do:
If date1>date2 then

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top