Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 November 4th, 2006, 06:11 AM
Authorized User
 
Join Date: Aug 2006
Posts: 39
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem with am/pm in GridView

Hi,

I want to show time part of a date type field to a column of GridView. For that I used DataTextFormatString="{0:HH:mm}" while defining column at design time. It works fine but when time is between 12:00 pm to 1:00 pm (which is 2006-11-04 12:10:00.000 in Sql Server in 24 hrs format), it still shows it in GridView as 12:00 am. It should show as 12:00 pm.

Code is as follows:

<asp:GridView ID="grdvwAppointments" runat="server" AutoGenerateColumns="False">
    <Columns>
         <asp:ButtonField DataTextField="Start_Date" DataTextFormatString="{0:HH:mm}"
         </asp:ButtonField>
    </Columns>
</asp:GridView>

Any ideas.:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting "Hooks.pm not found" error jromeirojr Perl 1 May 28th, 2007 06:39 AM
problem in gridview jaber.moh ASP.NET 2.0 Basics 1 March 19th, 2007 02:47 AM
Problem in GridView mohsin_khan BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 November 15th, 2006 03:07 PM
Formatting a Field Containing a Time to AM/PM taleriana XSLT 2 March 16th, 2004 11:10 PM
Time conversions from 24hr to am/pm Blaise Classic ASP Basics 2 July 14th, 2003 09:38 PM





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