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. 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. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,270
    Michael Borgwardt
    May 30, 2004
  2. Keith Cochrane
    Replies:
    2
    Views:
    624
    Keith Cochrane
    Aug 6, 2006
  3. Replies:
    1
    Views:
    801
    Paul Boddie
    Mar 11, 2007
  4. Replies:
    8
    Views:
    785
    Boris
    May 1, 2007
  5. Jonathan Wood
    Replies:
    1
    Views:
    2,204
    Jonathan Wood
    Nov 1, 2009
Loading...

Share This Page