Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Format date and time optional

Thread Tools

Format date and time optional

Posts: n/a
I have an page that has a GridView with bound columns. The date
column is bound to a SQL datetime column. I have the formatting of the bound
date to be Bind("ActivityDate", "{0:M/d/yyyy h:mm tt}") and it works fine.
However, sometimes records do not have a time and show as 7/21/2010 12:00 AM

Is there a way to not show the 12:00 AM as it is irrelevant when no time is
entered? Thanks.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post suggestion .. page, date, time and topic, date, time code (wish list). Keith Cochrane HTML 2 08-06-2006 06:57 AM
covert time from date Hour min sec format to epoch time i.e time since 1 jan 1970 in C Summu82 C Programming 5 06-07-2006 02:51 PM
Date/time with minutes and seconds optional? Randall Parker ASP .Net 2 12-08-2005 04:36 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM