datetimeoffset Questions

1

I am getting the LocalDateTime two hours lesser than the real time. How can I get the offset time for Berlin, Germany for the code below? LocalDateTime dateTime = LocalDateTime.ofEpochSecond(second...
Strychnine asked 3/4, 2019 at 11:26

3

Solved

A few months ago I was introduced to the new DateTimeOffset type and was glad DateTime's flaws with regard to time zones were finally taken care of. However, I was left wondering if there were any...
Tomb asked 5/11, 2008 at 8:35

5

Solved

I am a rookie python programmer and I need to write a script to check if a given date (passed as a string in the form 'Month, day year') is the third Friday of the month. I am using Python 2.7. Fo...
Condensable asked 25/8, 2013 at 0:22

3

I wanted to know if there is a way to get the time zone offset for a given date range between two timezones for a given duration. getTimezoneOffset(startDate,endDate,timezone1,timezone2){ ...miss...
Aphorize asked 6/2, 2012 at 15:41

4

Solved

I have the following code, which should return an offset of 60 (to show that in the UK at present, we are in British Summer Time - ie. 60 minutes ahead of GMT): var info = TimeZoneInfo.FindSystemT...
Brandling asked 22/10, 2014 at 11:21

3

I am trying to convert from java.sql.timestamp to OffsetDateTime so that i can return ISO8601 standard string in my rest api. I am using this code to convert from timestamp to OffsetDateTime publi...
Kamakura asked 29/4, 2016 at 21:14

5

Solved

Ok i've been working very hard the last few weeks and i've come across a small problem. I don't think my mind is quite up to the task right now :) so i need some tips/help! it's likely very simple ...
Dube asked 10/4, 2011 at 23:51

1

Solved

I have to calculate total fly time minutes between departure airport and arrival airport. This job is done by this code snippet: public int calculateFlightDuration(String departureDateTime, Str...
Mottle asked 4/10, 2017 at 7:43

2

Solved

There were quite a few questions about saving datetime & timezones info in DB but more on the overall level. Here I'd like to address a specific case. System specs We have an Orders system d...
Ician asked 7/7, 2017 at 7:58

1

Solved

I have looked at a lot of related questions but none of them seem to be working for me. I'm trying to serialize everything in UTC. Here's my code: class Class1 { static void Main() { Class2 f...
Lucilla asked 8/6, 2017 at 3:36

1

Solved

In a WinRT (Windows 8.1 Store App) project, I'm using the SQLite.Net-PCL and SQLiteNetExtensions NuGet packages to store data in a local SQLite database file. Several of my data models (aka tables...
Shepperd asked 1/2, 2017 at 15:48

4

Solved

I have a enum type called PaymentFrequency whose values indicate how many payments per year are being made... So I have public enum PaymentFrequency { None = 0, Annually = 1, SemiAnnually = 2,...
Grijalva asked 12/12, 2011 at 22:3

2

Solved

Given a SQL table with a DateTime column and approx 100k rows of various dates (local time PST values) from the past 3 years, what is the best strategy to migrate those column values to DateTimeOff...
Dael asked 13/8, 2013 at 19:49

1

jTDS currently doesn't support the datetimeoffset datatype introduced in SQL Server 2008. Can anybody suggest if there is a way to use the datetimeoffset type with jTDS?
Wirewove asked 4/4, 2016 at 14:22

1

Solved

I convert a string that represents a time in Pacific Time Zone that I am using to create a DateTime object: var pacificDateTime = new DateTime(2016, 11, 16, 15, 0, 0) // 11/16/2016 3:00:00 PM Us...
Homan asked 17/11, 2016 at 0:20

1

Is there a way that I can instruct Entity Framework to always store DateTimeOffset as the UTC value. Technically there is no reason for this but I prefer it if all the data in my database is consis...
Chercherbourg asked 10/10, 2016 at 14:44

3

Solved

I converted a table's DateTime field to DateTimeOffset, but now the offset is automatically set to +00:00. I need to change all DateTimeOffset fields of this table to an offset of +1:00. How can...
Shillelagh asked 25/11, 2015 at 9:14

6

Solved

I have an old table with a few rows that has a datetime column. I want to switch this to datetimeoffset but I want to be able to transfer the data that already exists. So I'm doing something like: ...
Deputy asked 5/1, 2010 at 19:27

3

Solved

My end goal is to get universal time from client with NO offset - just UTC time. I try to accomplish this like so: Javascript: (new Date()).toUTCString(), the output of which logs: Thu, 17 Mar 201...
Fireboard asked 17/3, 2016 at 15:45

2

I am using Azure Mobile Apps SDK for Android. public class MyClass { public String Id; public String Code; public DateTimeOffset ClientCreatedAt; } MyClass myClass = new MyClass(); myClass.Id ...
Piraeus asked 1/3, 2016 at 1:28

1

Solved

This code: DateTimeOffset testDateAndTime = new DateTimeOffset(2008, 5, 1, 8, 6, 32, new TimeSpan(1, 0, 0)); //CLEAN TIME AND DATE testDateAndTime = testDateAndTime.DateTime.Date; var datesTa...
Stgermain asked 16/5, 2016 at 15:47

2

I have two DateTimeOffset objects, which return like so when logging them: TIME 1 (db): 3/17/2016 2:25:37 PM +00:00 TIME 2 (client): 3/17/2016 2:09:19 PM -04:00 TIME 2 < TIME 1? False I don't...
Selfforgetful asked 17/3, 2016 at 14:35

3

I need to upgrade some piece of code from statically calling DateTime.UtcNow to calling a time provider service which returns, basically, DateTimeOffset.UtcNow. To further convert this DateTimeOffs...
Holloway asked 11/11, 2015 at 16:34

1

Solved

Our application is a big n-tier ASP.NET MVC application that is heavily dependent on Dates and (local) Times. Up until now we have been using DateTime for all our models, which worked fine because ...
Bugloss asked 16/10, 2015 at 10:15

1

Solved

I'm implementing conditional requests in a Web service. The backend can easily retrieve the last modified date of an entity, so I'm sending Last-Modified and getting back If-Modified-Since. The RFC...
Leong asked 9/10, 2015 at 20:2

© 2022 - 2024 — McMap. All rights reserved.