Convert UTC time to local time in SQL CE
-
mercoledì 4 luglio 2012 13:16
Hi,
I need to convert UTC time stored in the local CE store to local time and present it to the user. GetUTCDate is not a recognized function in SQL CE. Is there a way to convert UTC time to local time ? I'm using SQL CE v3.5.
Any help is appreciated..
- Tipo modificato Janet YeildingMicrosoft Employee venerdì 6 luglio 2012 17:49
- Spostato Janet YeildingMicrosoft Employee venerdì 6 luglio 2012 17:51 (From:SQL Server Data Tools)
Tutte le risposte
-
mercoledì 4 luglio 2012 15:19
Hello,
Why in SQL CE and not in the frontend, showing the dates?
You know the UTC offset for the local time, so just use DATEADD function to add the offset in hours.
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing -
giovedì 5 luglio 2012 02:04
Yeah., that is an option. I'm using NHibernate queries (HQL) in some places and thought it would be better off to write the queries rather than converting it again in the frontend. Might add to the performance degradation if i do it in the frontend?
Cheers!
-- Viswanth V.G
-
giovedì 5 luglio 2012 04:18
How many date do you want to show? If it's less then a million then there is not really a need to worry about performance.Might add to the performance degradation if i do it in the frontend?
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing -
lunedì 30 luglio 2012 12:43
Dear Viswanath,
process the required data using datetime class and then upload or download to db
regards
Suresh

