Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Date and Time query

Reply
Thread Tools

Date and Time query

 
 
Paul Evans
Guest
Posts: n/a
 
      12-19-2004
Hi,

I have created a datagrid which works just fine. One of the columns
retrieves the date which particular row was populated. However, the format
which the date is returned is:

19.12.2004 13:03:25

I only want to display the date that the row was populated, not the exact
time as well. Is there anyway I can do this, or is it an SQL problem when I
first created the table? I'm using a microsoft SQL server. The date is
generated automatically when a row is added to the table.

Thanks for your time

Paul Evans


 
Reply With Quote
 
 
 
 
Shawn
Guest
Posts: n/a
 
      12-19-2004
Is the date comming from a date field in your DB?
In that case you can format the date in your sql select statement.
Another method is to get the date for each row in ItemDataBound. Get the
date from you label/textbox and put it into a date variable, then save the
value back to the label/textbox using the method you want your date
diplayed. yourDateVariable.ToString("dd.MM.yyyy")

Hope this helps.
Shawn



"Paul Evans" <(E-Mail Removed)> wrote in message
news:%23ezw$(E-Mail Removed)...
> Hi,
>
> I have created a datagrid which works just fine. One of the columns
> retrieves the date which particular row was populated. However, the

format
> which the date is returned is:
>
> 19.12.2004 13:03:25
>
> I only want to display the date that the row was populated, not the exact
> time as well. Is there anyway I can do this, or is it an SQL problem when

I
> first created the table? I'm using a microsoft SQL server. The date is
> generated automatically when a row is added to the table.
>
> Thanks for your time
>
> Paul Evans
>
>



 
Reply With Quote
 
 
 
Reply

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
w3.org 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, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Date & Time chooser for java 1.1 - using only the mouse to select time & date Chris Berg Java 0 10-27-2003 10:59 PM



Advertisments