473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

formatting datetime field

djc
one of the columns in my asp.net datagrid shows a datetime value from an sql
server. By default is displays the date like this "mm/dd/yyyy hh:mm:ss am"
or the same ending in 'pm'. How do I make it only show the 'mm/dd/yyyy'
portion? Should I do this within asp.net/vb.net or should it be done
somewhere in the query that returns the data first?

any info would be appreciated. Thanks.
Nov 18 '05 #1
2 1209
..ToShortDate() is what I believe you are after.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"djc" <no***@nowhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
one of the columns in my asp.net datagrid shows a datetime value from an
sql
server. By default is displays the date like this "mm/dd/yyyy hh:mm:ss am"
or the same ending in 'pm'. How do I make it only show the 'mm/dd/yyyy'
portion? Should I do this within asp.net/vb.net or should it be done
somewhere in the query that returns the data first?

any info would be appreciated. Thanks.

Nov 18 '05 #2
djc
Thanks.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ua**************@TK2MSFTNGP14.phx.gbl...
.ToShortDate() is what I believe you are after.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"djc" <no***@nowhere.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
one of the columns in my asp.net datagrid shows a datetime value from an
sql
server. By default is displays the date like this "mm/dd/yyyy hh:mm:ss am" or the same ending in 'pm'. How do I make it only show the 'mm/dd/yyyy'
portion? Should I do this within asp.net/vb.net or should it be done
somewhere in the query that returns the data first?

any info would be appreciated. Thanks.


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
1
by: McGiv | last post by:
Hi, I'm trying to serialise some objects and I've can't get the built in serialisation to output exactly what I want. For the moment I'm implementing the IXmlSerializable interface and doing it...
1
by: Lauchlan M | last post by:
Hi In an ASP.NET application, I am doing the following (dtrData is a data reader that has been loaded with data already): if (dtrData.Read()) { lblEDPresentationTime.Text = (DateTime)...
6
by: Rookie Card | last post by:
I know this is a very common issue but cannot find a thread that resolves the issue. I need to re-format my dates to "MMM d, yyyy". The problem I have is I have an MSSQL database that allows...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
4
by: Wayne Wengert | last post by:
I am using VB.NET - VSNET 2003 and accessing data from an SQL Server. I am trying to convert a datetime field retrieved from the DB to a format like "MM/DD/YYYY" - I want results like "10/28/2004"....
4
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the...
11
by: tlyczko | last post by:
Hello, I'm new to SQL Server, working for a non-profit computerizing a lot of its data. I imported a table of people's names, birth dates, etc. into SS2005 from Access, and the birth_date was...
5
by: krishnakant Mane | last post by:
hello all. thanks for the help and for pointing me to the proper url for wxpython related issues. I am so happy that I now have a very easy gui library that can do practically every thing with...
1
by: Untitled | last post by:
I have an application that stores all DateTime inforamtion in UTC. However, this application will be accessed from arround the world. I would like my users to be able to specify their prefered...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.