create a date

G

Guest

ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes
 
P

Peter D. Dunlap

ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes

Try d = DateTime.Parse("5/5/2005")
 
M

Mythran

Kurt Schroeder said:
ok, simple question......
i want to set a datetime var with a specific date
i try
Dim d As DateTime
d.date = "05/05/2005"
or
d = 20050705
and so on,... how do i do it
thanks this is a basic basic one for most i guess..
thanks
kes

The others would work, but so does this :)

Dim d As DateTime = New DateTime(2005, 05, 05) ' year, month, day

HTH,
Mythran
 
G

Guest

you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes
 
G

Guest

you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes
 
G

Guest

you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes
 

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top