Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 16th, 2014, 03:08 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Date field in table shows time in GridView

Hi and TIA:

I have created a date field in a table where I specifically do not want a time listed along with the date (as opposed to datetime etc).

However, when I use my GridView control to show this and other fields, the date field is always appended with at time of 12:00:00 AM.

Even if I use SQL Server Managemtn Studio to insert just the date, when GridView shows the field the midnight time is included.

I am using VS2012

Is there a way I can programmatically make sure the time is not included?

Thanks,
Cliff
 
Old August 17th, 2014, 01:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Cliff,

Take a look at step 7 of the Try It Out "Customizing GridView Columns" on page 458 of Chapter 13. It shows you how to format dates to ignore the time part.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy date/time (DD/MM/YYYY HH24:MI:SS) in same table and same field but different row Wenggo BOOK: Beginning SQL 0 December 8th, 2013 07:51 AM
date time field adamhw SQL Server 2008 1 July 22nd, 2012 06:38 PM
Date Time Field not displaying Date and Time webmeister Access 2 January 31st, 2011 12:49 AM
Date/Time presentation in a GridView snufse ASP.NET 2.0 Basics 2 April 18th, 2008 08:24 AM
sorting problem with a date field in gridview jwrz200t Visual Studio 2005 0 September 21st, 2006 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.