Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Displaying Date & Time Question

Reply
Thread Tools

Displaying Date & Time Question

 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      03-06-2005
3/4/2005 5:50:08 PM

Normally i display the above time and Date above from Database by using
:-

<%= DateTime.Parse(dr["dt"].ToString()).ToShortDateString() %><br/>
<%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>

Any ideas how to display them together without having to seperate them
as i have done above???


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
gaidar
Guest
Posts: n/a
 
      03-06-2005
You can always define a public method to do this for you:

public string PrintDate(DateTime m_date)
{
return m_date.ToShortDateString() + m_date.ToShortTimeString();
}

But why not to use ToUniversalTime()

<%= DateTime.Parse(dr["dt"].ToString()).ToUniversalTime().Tostring() %>


--
Gaidar Magdanurov
VBStreets, Editor-in-Chief
private.php?do=newpm&u= / http://www.vbstreets.org

"Patrick Olurotimi Ige" <> wrote in message
news:...
> 3/4/2005 5:50:08 PM
>
> Normally i display the above time and Date above from Database by using
> :-
>
> <%= DateTime.Parse(dr["dt"].ToString()).ToShortDateString() %><br/>
> <%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>
>
> Any ideas how to display them together without having to seperate them
> as i have done above???
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF0cmljay5PLklnZQ==?=
Guest
Posts: n/a
 
      03-07-2005
Thanks Gaider for the response!..


"gaidar" wrote:

> You can always define a public method to do this for you:
>
> public string PrintDate(DateTime m_date)
> {
> return m_date.ToShortDateString() + m_date.ToShortTimeString();
> }
>
> But why not to use ToUniversalTime()
>
> <%= DateTime.Parse(dr["dt"].ToString()).ToUniversalTime().Tostring() %>
>
>
> --
> Gaidar Magdanurov
> VBStreets, Editor-in-Chief
> private.php?do=newpm&u= / http://www.vbstreets.org
>
> "Patrick Olurotimi Ige" <> wrote in message
> news:...
> > 3/4/2005 5:50:08 PM
> >
> > Normally i display the above time and Date above from Database by using
> > :-
> >
> > <%= DateTime.Parse(dr["dt"].ToString()).ToShortDateString() %><br/>
> > <%= DateTime.Parse(dr["dt"].ToString()).ToShortTimeString() %>
> >
> > Any ideas how to display them together without having to seperate them
> > as i have done above???
> >
> >
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!

>
>
>

 
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
Displaying a UTC date-time from DB in local-time in a GridView Kevin Frey ASP .Net 0 11-30-2006 03:18 AM
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
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
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57