I have dateTimeAuth column in sql table of datatype datetime and its default value is (getdate()) which returns me current time if i run my project at offline mode. When i uploaded it to live server it stores current time of default timezone GMT. I want value to be stored according to IST. How can it be done ?
Value stored accoding to GMT : 8/26/2010 1:02:28 PM Actual time accodring to IST :8/26/2010 7:02:28 PM
getdate() will always return the date and time where the server is located. If you want the date and time from your user's timezone, you need to send the date from the application and insert it as a regular dateTime variable
but if you are on SQL 2008, you can use
to get the date on your timezone. You can also add dates to it (+5:30 from UTC = IST)