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")
Comments
Post a Comment