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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get current date 1

Status
Not open for further replies.

asafb

Programmer
Jun 17, 2003
80
US
hello how do i retrieve the current date and pass it

tried date() doesn't work
tried cdate(thedate) but get syntax error 12:00:00 a.m.

i want short date format

08/08/2004

 
Try this,

string myDate = DateTime.Now.ToShortDateString();

Keith
 
If you just need the date you can use Today instead of Now.

Me.lblCurrentDate.Text = Format(Today(), "MM/dd/yy")

Hope this helps.

Hope everyone is having a great day!

Thanks - Jennifer
 
Thanks Jennifer it worked! you're the best! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top