Last post Dec 17, 2007 07:55 AM by rkchaudary
Nov 19, 2007 11:27 PM|rkchaudary|LINK
for example :
DataBase Time (UTC) : 2007/11/19 01:00:00
india's time zone offset is +5940000
so here i want is (2007/11/19 01:00:00)
which should give output as : 2007/11/19 06:30:00
but it is giving 2007/11/19 01:00:00
Nov 20, 2007 04:05 AM|shrinidhi|LINK
I can give few solutuions which i found in net
1) IF u directly want to get the local time from db via sp then try this :
CREATE PROCEDURE [dbo].[SomeProc]
SELECT dbo.udfConvertToLocal(@TimeZoneCode, SOME_UTC_DATE_FIELD) AS LocalDateTime
WHERE (ID = @ID)
GO /// to read in detail and more info, check this site :
Dim LocalTimeDate As DateTime = Now
Dim localzone As TimeZone = TimeZone.CurrentTimeZone
Dim Culture As
Dim DateTimeChanged As
DateTimeChanged = DateTimeChange + localzone.GetUtcOffset(LocalTimeDate)
3) or Check this demo which has done
4) OR Check this
Dec 17, 2007 07:55 AM|rkchaudary|LINK
Here 2 case is suitable for me but, in this try with the following
dim dt as string = "2007/12/17 05:30:00 AM UTC" ' a time in database
and then try to add 56000 ticks to get local time of india at that particular point of time. (now the time is 2007/12/17 01:00:00 AM UTC"
then it is giving the problem.
it is displaying "2007/12/17 05:30:00 AM" only,where as "2007/12/17 11:00:00 AM" is expected.
please let me know if you need anyother info..
thanks & regards