Need server time accoring to Indian GMT..

Posted by Susantaown under ASP.NET on 8/19/2009 | Views : 3344 | Status : [Member] | Replies : 2
Hello Frnds..

Our application like...

1: user logon time: 10AM - 5PM (this thing i am storing in SQL server )
3: Our server is in USA..
3: So whenever i am trying to check user Logon time I am taking server Time and comparing with Database storing time (10AM -5PM)..

4: Whenever i am trying to Logon its showing error Invalid Loagon Time .. Because in USA its 8.00PM and in India its 10AM ... so i was unable to logon...

I am getting the concept i have to check GMT+5.30 but i dont know how to implement?


Need a quick help in this regard..

susant




Responses

Posted by: Raja on: 8/20/2009 [Member] Starter

Up
0
Down
Following are some clue.

Get the time from the database and use Databasetime.AddMintues, DateTime.AddHours etc functions to add 5 hours and 30 minutes. After that you try to validate the users.

Thanks


Regards,
Raja, USA

Susantaown, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RtpHarry on: 8/20/2009 [Member] [MVP] Bronze

Up
0
Down
Hi,
There are many problems with moving over time zones such as daylight savings times and changes of the length of year etc.

Please see this article for an introduction to the TimeZoneInfo class:
http://stackoverflow.com/questions/319367/how-to-convert-server-time-to-local-time

Susantaown, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response