Hello,
ASTrace runs on the same server as AS being traced and SQL where log table is.
StartTime and CurrentTime have 2 hours shift to system clock.
Same events in Profiler (simultaneously traced) have no time shift.
What can it actually be?
Thank you in advance!
Michael.
Comments: ** Comment from web user: koehlerb **
ASTrace runs on the same server as AS being traced and SQL where log table is.
StartTime and CurrentTime have 2 hours shift to system clock.
Same events in Profiler (simultaneously traced) have no time shift.
What can it actually be?
Thank you in advance!
Michael.
Comments: ** Comment from web user: koehlerb **
The problem looks to be that the TraceServer returns UTC time. No good workaround, though you can correct using SQL.
e.g.
DECLARE @utcOffset int = (SELECT CAST(GETDATE()-GETUTCDATE() as float)*24)
SELECT DateAdd(hour,@utcOffset,StartTime) FROM dbo.ASTrace
This does not account for changes in daylight savings time.
What is needed is something like the dataReader
System.Data.IDataReader dataReader;
...
value = dataReader.GetValue(counter);
if (value != null)
{ //time is in UTC, convert to localtime
if (value.GetType() == typeof(DateTime))
{
value = DateTime.SpecifyKind((DateTime)value, DateTimeKind.Utc).ToLocalTime();