Convert to local date/time when page is rendered?

Discussion in 'ASP .Net' started by Randall Parker, Dec 15, 2005.

  1. I realize that methods like DateTime.ToLocalTime() and DateTime.ToUniveralTime() exist.

    But suppose one wants to query out data from a database that has UTC times in it.
    Suppose one wants to have a DataGrid with BoundColumn rows that are dates and times.
    Can one somehow in specifying the formatting for a date column say "date the bound
    date and treat it as UTC and convert it to PST when the page is rendered"?

    Or does one have to go thru the dataset and do date math on every date column in
    every row before doing the DataBind() call?

    I'm not even sure whether the database I'm using (MySQL) thinks it is handing me UTC
    dates. But I just found out that the data feed I've got comingi in is providing UTC
    dates and I'm going to have customers in a few different time zones wanting to look
    at forms in theirr time zones.
     
    Randall Parker, Dec 15, 2005
    #1
    1. Advertisements

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. Salim Afsar

    convert local time to another country time

    Salim Afsar, Mar 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    880
    Juan T. Llibre
    Mar 16, 2006
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,786
    Michael Borgwardt
    May 30, 2004
  3. wgan
    Replies:
    7
    Views:
    809
    Roedy Green
    Jul 8, 2004
  4. Keith Cochrane
    Replies:
    2
    Views:
    849
    Keith Cochrane
    Aug 6, 2006
  5. Replies:
    1
    Views:
    1,013
    Paul Boddie
    Mar 11, 2007
  6. Replies:
    8
    Views:
    1,047
    Boris
    May 1, 2007
  7. deepak
    Replies:
    1
    Views:
    31,677
    Kevin Spencer
    Feb 6, 2008
  8. Jonathan Wood
    Replies:
    1
    Views:
    2,414
    Jonathan Wood
    Nov 1, 2009
Loading...