Displaying Date & Time Question

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Mar 6, 2005.

  1. 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!
     
    Patrick Olurotimi Ige, Mar 6, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige

    gaidar Guest

    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: / 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!
     
    gaidar, Mar 6, 2005
    #2
    1. Advertising

  3. 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
    > mailto: / 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!

    >
    >
    >
     
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Mar 7, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Berg
    Replies:
    0
    Views:
    844
    Chris Berg
    Oct 27, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,365
    Michael Borgwardt
    May 30, 2004
  3. Keith Cochrane
    Replies:
    2
    Views:
    649
    Keith Cochrane
    Aug 6, 2006
  4. Kevin Frey
    Replies:
    0
    Views:
    631
    Kevin Frey
    Nov 30, 2006
  5. Summu82
    Replies:
    5
    Views:
    900
    Richard Heathfield
    Jun 7, 2006
Loading...

Share This Page