winforms - Date and Time Format Problems in vb.net -


i trying truncate seconds part current date

  dim nowtime datetime = now.toshorttimestring 

the above code shows time in format

hh:mm:ss

i want in format

hh:mm


the date time picker shows date this

5/ 1/2011

(there space before 5 , before 1)

 dim nowtime datetime = now.toshorttimestring 

the above code shows date this

5/1/2011

(there no space before 5 or 1)


i trying compare current date , time date , time in database.

in database have saved date , time string.

you need apply correct formatstring datetime.tostring()

datevalue.tostring("hh:mm") 

and date:

now.tostring("mm/dd/yyyy") 

more here


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -