Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To support timezone DateTime
Message
 
 
À
04/04/2009 09:36:48
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01393251
Message ID:
01393404
Vues:
34
>>Hi,
>>I am developing an application which would supports multiple country (one country per database/application). How could I manage the datetime for each country application/database which reside at the same server? For example, store datetime value and display current datetime based on specified timezone. Any other thing need to be considered?
>>
>>Thank you
>
>Instead of using GETDATE() function use GETUTCDATE() function. That will return UTC date time. Then when user wants date back you should convert it to Local time:
>http://www.codeproject.com/KB/database/ConvertUTCToLocal.aspx
>
>http://www.windows-tech.info/15/9115c76955a6a6e1.php

I haven't checked, but was this function introduced in SQL Server 2008?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform