...

View Full Version : date and time in my asp.net



fadodz
04-17-2007, 05:31 PM
hey friends...
i am using visual studio .net and mssql 2000 for my database...the problem here is when i want to display the date for my stock, it is include with time...so how can i display just the date only...not with the time.

Krokador
04-17-2007, 05:34 PM
There is a bunch of date and time formatting available in visual basic.net. Namely:

ToLongDateString()
ToShortDateString()

just use it like any ToString() method call and it should work fine.

Example:
lblDate.Text = Date.Today.ToShortDateString()

hope that answers your question :)

nikkiH
04-17-2007, 05:50 PM
Also, if it's in a grid, there are special format strings for dates right in the designer.
See DataFormatString.
http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum