datetimeoffset

How to use TimeZoneInfo to get local time during Daylight Savings Time?

I'm trying to use DateTimeOffset to convey a specific moment in time across any time zone. I can't figure out how to use TimeZoneInfo to deal with daylight savings time. var dt = DateTime.UtcNow; Console.WriteLine(dt.ToLocalTime()); var tz = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); var utcOffset = new DateTimeOffs...

Working with Time Zones in SSRS

We store all our dates SQL Server 2008 database in UTC time in DateTime columns. I'm using SSRS to create reports and I need to convert all the times on the reports to the Time Zone of the computer where they're running the report from. I know could always just pass in the current timezone offset as a parameter to the report and add o...

Qt QDateTime nanoseconds from 1/1/1970

I am about to read data From a File which has stored it's time in nanoseconds from 1/1/1970. My problem is I want to read it to a QDateTime object, but it simply does not work as I want it to and the Qt Documentation did not help me either. Note: milliseconds raster is enough for my purposes Here my current approach: void setDateTime(q...

Javascript ASP.net date format without timezone info - timezone offsets

I have a client side JavaScript that generates a date in JavaScript( new Date(2007,5,1)). I need this date passed through to a hidden field that the code behind can access. My issue is that when the hidden field is converted into a DotNet datetime, the time is incorrect. This is because the JavaScript is including timezone info from th...

sql server 2008 timeing related

I want to find out what will be the time in India when clock tick to 1Am mid night in any other country.. How i will find out that through any means plz help me to find out this this is to fire birthbay mails at 1AM midnight of that resp country... so i did following DECLARE @indianTime DATETIME --= SYSDATETIMEOFFSET() DECLARE @timeZon...

convert datetime js to c#

How would I convert this from js to C#. I've looked but cant find anything useful. var endDate = new DateTime(); endDate.setDate(startDateTime.getDate() + days); endDate.setHours(endDateTime.getHours(), endDateTime.getMinutes(), endDateTime.getSeconds()); ...

Using DateTimeOffset as WHERE criteria in a SQL Server 2008 query

Hi Everyone, I was wondering if anyone could help me understand why these two criteria do not return the same result sets. To me, it seems weird that SQL Server 2008 R2 wouldn't know to use the offset while constraining the data. Is there a better way to do this? As far as I can tell, Criteria Two is the only way to get the correct data...