Daylight saving time and time zone best practices

I am hoping to make this question and the answers to it the definitive guide to dealing with daylight saving time, in particular for dealing with the actual change overs. If you have anything to...

DateTime vs DateTimeOffset

Currently, we have a standard way of dealing with .NET DateTime's in a TimeZone aware way: Whenever we produce a DateTime we do it in UTC (e.g. using DateTime.UtcNow), and whenever we display one,...

What would be the Python code to add time to a specific timestamp?

Trying to figure out datetime module and need some help. I've got a string which looks like this: 00:03:12,200 --> 00:03:14,316 (that is hours:minutes:seconds,milliseconds) and need to add let's...

Subtract 1 day with PHP

I'm trying to take a date object that's coming out of my Drupal CMS, subtract one day and print out both dates. Here's what I have $date_raw =...

How to cast datetime to datetimeoffset?

How can i convert an SQL Server datetime value to a datetimeoffset value? For example, an existing table contains datetime values that are all in "local" server time. SELECT TOP 5 ChangeDate FROM...

Getdate() function to get date for my timezone

I would love to insert a default value into a column with data type datetime2(7). However, because my website is hosted on a server in a different timezone, the getdate function doesn't work...

WebAPI returning File and download is not starting

Having a very strange problem, when I'am returning a file as a "HttpResponseMessage", it works when iam returning pdf file, but when I'am returning a xls file(excel file) it does not. Here is the...

NPoco / PetaPoco and Noda Time types

I'm just starting to play around with NPoco, but as of yet I haven't located what I need in the docs. For instance, let's say I have a field Created, which is an Instant in my domain, but a...

QuickBooks Web Connector TimeModified offset does not account for Daylight Savings time

I'm using QuickBooks Web Connector to pull employee records out of QuickBooks Desktop on a Windows 8.1 machine using QBXML requests. Is there a reason the TimeModified time stamps are returning...

Automapper: map properties manually

I just started to use automapper to map DTOs<->Entities and it seems to be working great. In some special cases I want to map only some properties and perform additional checks. Without automapper...

pandas out of bounds nanosecond timestamp after offset rollforward plus adding a month offset

I am confused how pandas blew out of bounds for datetime objects with these lines: import pandas as pd BOMoffset = pd.tseries.offsets.MonthBegin() # here some code sets the all_treatments...

Parse date time c# with correct timezone and kind

I have a datetime in database which I read using SqlDataReader and then cast it to (DateTime). After the cast its Kind property is DateTimeKind.Unspecified. Then I have another string which I read...

String of date to OffsetDateTime

I am converting string of date/datetime to OffsetDateTime and I have datetime format which may have one of these values yyyy-MM-dd, yyyy/MM/dd Sometimes with and without time and I need to...

Is it possible to determine the UTC offset from two timestamps?

Let's say I have two timestamps. One is in UTC, and the other's timezone is unknown, but has a date and a time. The format of the latter is YYYY:MM:DD HH:MM:SS. Is it reasonable to get the offset...

Azure Searching Metadata in blobs

I am try to find a way to bring back only items in blob storage with metadata that matches a particular piece of data. All fields will have a key called 'FlightNo'. What I want really want is a...

Cloud Firestore: Storing and querying for today's date over multiple UTC offsets?

I'm writing a web app using Firestore that needs to be able to show "Today's Popular Posts" and I'm having trouble getting the queries right when considering users in different timezones. The...

Core 2.0 API Auth with JWT returns unauthorized

I'm trying to add Token Authentication with JWT to my .Net Core 2.0 app. I have a simple controller that returns a list of users for testing. [Authorize] [Route("api/[controller]")] public class...

C# - Convert date to unix timestamp

I am trying to convert the date Saturday, 22. October 1932 00:00:00 to the unix timestamp -1173747600000. My code here: DateTimeOffset dt2 = new DateTimeOffset(new DateTime(1932, 10,...

ValueGeneratedOnAdd has no effect

For example, I have the next table: CREATE TABLE Person ( id int IDENTITY(1,1) NOT NULL PK, firstName nvarchar(20) NOT NULL, lastName nvarchar(30) NOT NULL, birtdate datetimeoffset(7) NOT...

MS Flow: SQL Server Get_rows - We cannot apply operator < to types DateTimeZone and DateTime

Problem I am trying to write a simple Flow that gathers some rows from my SQL Server database and sends the data to me via email. However, I am having trouble filtering these records by date. I...

identity server with plesk: Couldn't find a valid certificate with subject 'CN=SigningCertificate'

Im working with a web hosting server and they have a plesk interface. I'm getting an error when I try to deploy my asp net core api with angular. Actually it is a basic net core 3.0 template with...

C# DateTime - converting a DateTimeOffset to another TimeZone

When converting a DateTimeOffset to another TimeZone, the OffSet is incorrect. I've read many articles and experimented for too many hours, but can't see what I'm missing here: // It's June in the...

Unable to update timestamp property in HubSpot

I have a custom property for the contacts entity in HubSpot. This property is defined as field type "Date Picker" in my code C#, I have a contact object that I serialize with a property bound to...

How can I sign a JWT with RSA SHA256 in an Azure API Management Policy Expression?

In an Azure API Management Policy Expression I need to create a JWT signed with a private key. When I try to use RSACryptoServiceProvider - just to check whether this feedback already got resolved...

Deconstructing ZonedDateTime

Using NodaTime, and I'm looking to deconstruct a ZonedDateTime in order to save it to a SQL database. It seems to me there are a few options. I could deconstruct it to Instant and DateTimeZone...

Duplicate key value Error when updating a lot of data

When I want to save a lot of data in the database (PostgreSQL 12 and the Entity Framework Core (C#)) I get the following exceptions: fail: Microsoft.EntityFrameworkCore.Database.Command[20102] ...

How can I format a DateTimeOffset to not have a colon in the timezone offset?

I was reading this MSDocs article about DateTime-related format support https://docs.microsoft.com/en-us/dotnet/standard/datetime/system-text-json-support#support-for-the-iso-8601-12019-format And...

502 Error: Bad Gateway on Azure App Service with IronPDF

I am attempting to get IronPDF working on my deployment of an ASP.NET Core 3.1 App Service. I am not using Azure Functions for any of this, just a regular endpoints on an Azure App Service -which,...

Deadlock on insert/select

Ok, I'm totally lost on deadlock issue. I just don't know how to solve this. I have these three tables (I have removed not important columns): CREATE TABLE [dbo].[ManageServicesRequest] ( ...

How to index a many-to-many relationship in RavenDb?

I have a model in RavenDb that I am trying to assemble into an index that will make identifying Clips for Channels you follow. Here are the two objects (properties simplified for discussion) I'm...