Sunday, February 26, 2012

GMT time to CST with daylight savings

I have the database on a GMT server and a logdate that is in GMT too. How do I convert this into CST (GMT -6) , during daylight savings (GMT-5) when passing it back to the webpage.

I can use DATEADD(hh,-6,LogDate) but how do I know if the daylight savings period has started to do DATEADD(hh,-5,LogDate). I also want to solve this at the database level without altering the front-end.

Thanks.

Is your database server in CST? And really, the conversion SHOULD be done on the front end.|||

database is on GMT.

Ok if on frontend how do i do it. I have around 7000 rows to be retrieved and all need to be converted to CST from GMT. Is there a quick way to do this. I have everything in the dataset/datatable.

|||Also the server now is on CST but can be moved to EST anyday. Can I have a key in web.config to be changed when this is done. Daylight savings is also an important issue here.

No comments:

Post a Comment