Displaying Date & Time Question

  • Thread starter Patrick Olurotimi Ige
  • Start date
P

Patrick Olurotimi Ige

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???
 
G

gaidar

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() %>
 
G

Guest

Thanks Gaider for the response!..


gaidar said:
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
mailto:[email protected] / http://www.vbstreets.org

Patrick Olurotimi Ige said:
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???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top