Click to See Complete Forum and Search --> : is there a way to remove the time on the calendar?


Trance
01-07-2005, 12:54 AM
hi guys long time no c...erm...recenty i encountered a problem...it is considering the calendar's function. i enable my user to select a date from my calendar and i display it on the next webform using datagrid. but that is where the problem start. on the requested date session , there is the requested date and together with it is the time showing 12:00:00 AM? can any1 help me in removing the time away? thank...by the way, i'm using the platform .Net, the language is VB. thank...

Trance
01-13-2005, 03:16 AM
can some one pls help?? pls solve me or at lwast offer any advice that would be helpful to me ok? please

dtch
01-13-2005, 10:08 AM
When working with date data type you can format it the way you want it.

For example, in your calendar SelectionChanged event you can do this:

Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Label1.Text = Calendar1.SelectedDate.ToShortDateString
End Sub

If you use the ToShortDateString formating you get only the date without the time in the format 1/13/2005. If you use ToLongDateString your date will look like this: Thursday, January 13, 2005.

Good Luck!

PeOfEo
01-13-2005, 12:42 PM
it would be helpful if we know the problem ;)

Trance
01-13-2005, 08:23 PM
it is another issue i posted...another issue post abt the calendar how to remove the time

PeOfEo
01-13-2005, 08:27 PM
threads merged.