Date Time

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

How do you get just the date part of a datetime value = 1/1/2005 11:15:00
AM.

Result = 1/1/2005

Isn't there something built into the date functions in VB?

I am using vb in asp.net

Thanks
 
Craig said:
How do you get just the date part of a datetime value = 1/1/2005 11:15:00
AM.

Result = 1/1/2005

Isn't there something built into the date functions in VB?


\\\
Dim d1 As Date = ...
Dim d2 As Date = d1.Date
///
 
Craig,

When you next time give a question about dates than don't do it with the
sample you did.

Because of the AM, I think that you are from the USA. If you use something
as

12/31/2005 11:15:00 AM than everybody can see that direct.

The most easy method is to convert that string to a DateTime with
Cdate(mystring) and than get the individual parts from a property or a
method from that.

http://msdn.microsoft.com/library/d...pref/html/frlrfsystemdatetimememberstopic.asp

I hope this helps

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top