create a date

  • Thread starter Thread starter Guest
  • Start date Start 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
 
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")
 
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
 
you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes
 
you guys are too great. I know this was a no-brainer, but i get these brain
blocks, and, well....
thanks
kes
 
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

Similar Threads


Back
Top