Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying local DateTime when bound to UTC DateTime
Message
De
07/11/2008 11:42:45
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
07/11/2008 07:01:29
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01360349
Message ID:
01360541
Vues:
9
Here is what I have and it does not work as of yet. (I had to replace all the angle brackets for square brackets to post it.)
    [ EditItemTemplate ]
           [ mm:mmLabel ID="lblTime" runat="server" Text=' [ %# DisplayLocalTime(Eval("Spot_Time"))%] ' ] [ /mm:mmLabel ]
    [ /EditItemTemplate ]
The method is:
  protected string DisplayLocalTime(Object value)
  {
       DateTime utcTime = (DateTime)value;
       DateTime localTime = utcTime.ToLocalTime();
       string displayTime = localTime.ToShortTimeString();

       return displayTime;
  }
I can set a breakpoint in the method and it never fires. If I can get the method to fire, then I can set the required local time per the data setting.
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform