Questions tagged [datetimeoffset]
DateTimeOffset is a data structure that encapsulates a DateTime value and the Offset from UTC that the value reflects. It is used to represent an instantaneous moment in time, while still capturing the perspective of the observer.
600
questions
0
votes
0
answers
16
views
send datetime with offset field in Stream Analytics
I'm trying to send a Timestamp field which is ISO 8601 with offset (
"2023-02-01T11:11:12.2220000+03:00" )
Azure doesn't really work with offsets, I first encountered that when sending data ...
1
vote
1
answer
32
views
Create a custom business day frequency for pandas.date_range
Let's assume we want to build a DatetimeIndex object consisting of all Mondays and Thursdays in 2023. How would one go about doing this using pandas?
Specifically, I have the start and end of a time ...
3
votes
2
answers
79
views
Date conversion: add UTCOffset to existing timezone
I have date which is in the format of(example) Date = 2023-01-09T23:51:44.595Z
and I have utcOffset String utcOffset = "UTC +6"
I want output as 2023-01-10T05:51:44.595Z in Date format.
How ...
1
vote
1
answer
38
views
Time difference calculation based on timezone and offset
We transfer data from Oracle SQL to SQL Server in the near real-time data warehouse. (Oracle is a transactional database) The time changes twice a year for the data we use. We have been having issues ...
0
votes
1
answer
54
views
Convert DateTimeOffset to DateTime in a where between 23:00 previous day an 07:00 Am next day for past 2 weeks
I have to make an query on a table where the datetime field is of type datetimeoffset.
The query itself is already difficult, but now working with conversions makes it even more complicated. What I ...
0
votes
1
answer
26
views
DateTime to quarter end in Pandas
My current date is in this format "202003", "202006", "202009". I want to change it to "2020-03-31", "2020-06-30", "2020-09-30".
Here is my ...
0
votes
0
answers
40
views
Check if DateTimeOffset is an interval of a timespan
Hello I've been trying to figure out how to tell if a DateTimeOffset is an interval of a timespan.
For example:
if you have a date of something like:
I've found a solution that works sometimes, but ...
0
votes
1
answer
34
views
Illegal sap.ui.model.odata.type.DateTimeOffset
Posting for prosperity. I had zero hits from google.
I'm writing a SAP Business One Web Client extension. I'm using the worklist template and have the b1s/v2/ Service Layer metadata (auto generated ...
0
votes
0
answers
30
views
How to make a naive datetime an aware datetime using pandas to_datetime() method
I have tried to make a datetime object selected from my dataframe (with a time column: (Time_utc) in Unix time), an aware datetime using to_datetime() method in pandas, but I don't seem to know how. I ...
0
votes
0
answers
25
views
Why do I need to set a timezone for my server, but not using Unix Timestamp?
I am a newbie to backend and creating a backend server that handles multiple countries' data.
Some countries have a daylight saving issue that requires us to correct timezones twice a year regarding ...
0
votes
1
answer
67
views
Convert Datepicker Date to ToIsoString
i want to convert date from datepicker to toisostring in angular.
my problem is when i add data from to backend a have date day before one day
my code is HTML:
<mat-form-field appearance="...
0
votes
0
answers
51
views
Is it possible to setup default value for DateTimeOffset struct?
The situation:
I may have such strings "12/12/2022 10:10:10" or "10:10:10" and i need parse them to DateTimeOffset. If i use TryParse(stringVal, offset), the date for second string ...
-1
votes
1
answer
27
views
C# How to DateTimeOffset.Parse 2022003023T05:57:44.200Z?
I tried DateTimeOffset dto = DateTime.ParseExact("2022003023T05:57:44.200Z", "yyyyMMMMdd'T'HH':'mm':'ss'.'fff'Z'", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); ...
0
votes
1
answer
63
views
day incorrect in angular material datepicker -day before the exact date
hello When I select a date I see the correct date in the field but, when I save, the datepicker send the day before the date. i use datetime picker range
code html:
<mat-form-field appearance=&...
1
vote
4
answers
153
views
Pandas - Convert datetime column to start of week date (Sunday)
I've been trying a handful of methods here and can't seem to get it right. What I want to do is look at a datetime stamp column, and create a new column that has the Sunday start of that week.
It ...
2
votes
0
answers
40
views
How can I store Hijri date inside Sql Server DateTimeOffset column?
I am working on a legacy website and they are storing all Hijri dates inside nvarchar(10) column. Now they are rebuilding the system and they need to convert from nvarchar(10) into DateTimeOffset ...
1
vote
1
answer
77
views
Most efficient way to do rolling window on a datetimeindex with a data offset from the index
I am trying to calculate statistics over a shifted/offset rolling window of an inconsistent datetimeindex of a dataset in a pandas dataframe. I want to bring these statistics back to the current ...
1
vote
1
answer
180
views
Python datetime only returning negative numbers?
I have the following code:
commit_date = get_last_commit_date() # returns datetime obj: 2022-08-25 13:32:12
pr_date = datetime.fromisoformat(ISO_CODE) # returns 2022-08-24 19:15:07
Notice how ...
0
votes
1
answer
66
views
ValueError: '2' is a bad directive in format '%Y-%m-%d%20%H:%M:%S'
I am trying to get data from an API that sends the time like "2022-08-15%2013:00:00" in string format, How do I convert it into a datetime format? I have tried -
start_time = "2022-08-...
0
votes
0
answers
119
views
How to convert the Zulu datetime to UTC with offset in pyspark and spark sql
I have the below date time in string type. I want to convert that into UTC with offset
spark = SparkSession.builder.appName("Test").enableHiveSupport().getOrCreate()
print("Print ...
0
votes
1
answer
67
views
converting datetime column to total hours and offsetting from reference time
I have the following datetime object:
import pandas as pd
from datetime import datetime
t0=datetime.strptime("01/01/2011 00:00:00", "%d/%m/%Y %H:%M:%S")
here, t0 is my reference ...
0
votes
0
answers
43
views
Is it possible to make Visual Studio throw a build error on implicit casts of DateTime to DateTimeOffset?
Is it possible to make Visual Studio throw a build error on implicit casts of DateTime to DateTimeOffset?
E.g.
var testDate = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Unspecified);
var checkDate ...
1
vote
1
answer
132
views
How to deserialize DateTimeOffset during aggregation
I have the following code.
class TheThing
{
public int Number { get; set; }
public DateTimeOffset Date { get; set; }
}
static void Main(string[] args)
{
var client = new MongoClient();
...
0
votes
0
answers
229
views
Retrievieng time offset of local computer with respect to an NTP Server
I am currently developing a c++ code on Windows OS which uses windows api to set and get system time as I need to apply some offset to my local time (in the range of few seconds). As in my final ...
-1
votes
1
answer
2k
views
How can I change date formats "2022-06-04T00:00:00.000Z" to "1525844100000" for react highcharts
I've the following date: "2022-06-04T00:00:00.000Z" format, We've need of date calculation for highcharts in this numeric type format "1525844100000" so how can I calculate in ...
-2
votes
1
answer
206
views
Regex for DateTimeOffset validation in url?
How to validate the date and time in the url that is the correct DateTimeOffset format?
DateTimeOffset format (basically starts with 4 digits of year and end with uppercase Z):
yyyy-mm-ddZ
yyyy-mm-...
0
votes
0
answers
76
views
Python: offset data by 30 days
I have a DataFrame like this:
df = pd.DataFrame(index=pd.date_range(start='2022-01-01', end='2022-05-01', periods=100))
df:
2022-01-01 00:00:00.000000000
2022-01-02 05:05:27.272727272
...
2022-04-29 ...
0
votes
2
answers
169
views
Can you make SQL Server datetimeoffset "nullable"?
I have an API that receives datetimeoffsets, and stored in a SQL Server in a DateTimeOffset column. However, some of the users of the API do not have the timezone information.
In that case, the system ...
2
votes
3
answers
182
views
How to work with gas days in a C# project?
A gas day is defined as a time range of 24 hours which starts at 5:00 UTC and ends at 5:00 UTC of the following day during the European standard time. During the European daylight saving time, it ...
-2
votes
2
answers
112
views
How to format a date with parentheses
I want to format my date like :
From May 1 (10:02 pm) to May 3 (10:02 pm)
so I have this code:
Time.ToLocalTime().ToString("MMM. d, (h:m tt)")
Will this work?
Time is a regular ...
-1
votes
1
answer
80
views
Using linq to return records from sql server based on users datetimeoffset
I have a dateTime offset value that gets passed from the UI which looks like
startDate:2022-04-25 21:08:02.2973333 +00:00 but the date i entered is actually the 26th
i want to get the records from the ...
1
vote
0
answers
46
views
How to apply custom deserialization to DateTimeOffset field by System.Text.Json
How should I configure my deserializations to behave differently according to the data in json. When the time field contains an offset (like in the example payload1), I would like the deserialized ...
0
votes
1
answer
73
views
Trying to get 'QS' frequency in pandas for a datetime64[ns] gives attribute error
I am working with an external data source and I am trying to get Quaterstart(QS) frequency for a particular data field. I am providing a dummy data and code below.
import pandas as pd
df = pd....
0
votes
2
answers
62
views
Issue when converting microseconds to datatimeoffset c#
I am trying to convert microseconds to DateTime. Please find the code below,
long microSecs = 1632489907280; // Working
long microSecs = 1650391805000000 // Not working -- It has nanoseconds also.
...
1
vote
0
answers
2k
views
Parameter value [2022-04-13T09:20:49Z] did not match expected type [java.time.OffsetDateTime (n/a)];
org.springframework.dao.InvalidDataAccessApiUsageException: Parameter
value [2022-04-13T09:20:49Z] did not match expected type
[java.time.OffsetDateTime (n/a)]; nested exception is
java.lang....
0
votes
1
answer
83
views
How to remove +00.00 from dictionary value c#
I have a Dictionary<string, object> collection.
and the dictionary object looks {8/8/2021 1:38:34 PM +00:00} (datetime object)
Facing some milliseconds problem because of +00:00.
Need to remove +...
1
vote
1
answer
109
views
(.net) Unexpected offest when call DateTime.Today.AddDays
I have a test that started to fail today,
after a little investigation I found that the returned date differ by 1 hour, more precisely it results to have 1 hour offset (the current offset I have in my ...
0
votes
0
answers
185
views
DateTime is changing when passed to Cloud
We have a VueJS app that is passing a JSON object back to the WebAPi. The WebApi is sitting on a VM in the cloud.
This JSON object will have a datetime property, along with other properties.
In the ...
2
votes
2
answers
261
views
DateTimeParseException while parsing date using ZonedDateTime
I have the below program and looks like ZonedDateTime is not able to parse the date string. Should I use a different date format or different library to parse?
import java.time.ZonedDateTime;
import ...
0
votes
0
answers
120
views
Getting different datetime in different region while using the timespan of same date returned from de-serialized Json object
I am getting different dates as a result while displaying it in the UI.
I am getting a de-serialised json object which contains date time in the format of
row.Date => {1/1/2021 12:00:00 AM}
the ...
0
votes
1
answer
2k
views
How to enable Time Zone support for ASP.NET Core API?
I've got a mobile app and a Web application that consumes an ASP.NET Core 3.x WEB API that uses SQL Server as it's datastore. The client applications can be in different Time Zones.
The dilemma I'm ...
1
vote
1
answer
3k
views
OpenAPi DateTime with timezone information
I am creating OpenApi Doc for an API.
Having a model object field with DateTime info with timezone.
Example: "2021-12-30T10:00:00+00:00"
The expected input date should be in UTC.
If I use ...
1
vote
1
answer
83
views
Parsing amazon app store purchaseDate receipt string to DateTime
The purchase receipt from the amazon app store has a purchase date formatted as "Wed Feb 02 17:28:08 GMT+00:00 2022" however I'm not sure how to properly convert this to a valid DateTime due ...
0
votes
2
answers
1k
views
Convert DateTime to DateTimeOffset taking into account SummerTime
Consider the code below. I have a list of dates around the point in time when CEST changes from summer to winter time. I need to convert them to UTC. However using this code the midnight gets lost, I ...
-1
votes
1
answer
203
views
SQL: Convert GMT timezone to CET
I am querying the following:
SELECT "date" FROM "database"
and receive the following table:
date
2021-03-08 05:05:31+00
2021-03-08 05:10:31+00
The times displayed are in GMT. How ...
0
votes
1
answer
361
views
Creating a DateTimeOffset in a Timezone Different to the One the User is In
I want to create a DateTimeOffset which is the date that I specify, but in another timezone.
There's a bit of a catch to this. 2 things:
-1- I am NOT in the TimeZone in which I am interested i.e. it ...
2
votes
1
answer
693
views
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://learn.microsoft.com/en-us/dotnet/standard/datetime/system-text-json-support#support-for-the-iso-8601-12019-format
And I ...
3
votes
2
answers
312
views
TimeSeries conversion from CET / CEST to UTC
I have two time series file which is meant to be in CET / CEST. The bad one of them, does not write the values in a proper way. For the good csv, see here:
#test_good.csv
local_time,value
...
2017-03-...
0
votes
0
answers
227
views
In C# what is the DateTime Format of a DateTimeOffset value: "2019-01-31T17:32:00-05:00"?
In my C# code I am working with DateTimeOffset? values that I need to validate are in a given format. Here is an example value: 2019-01-31T17:32:00-05:00. The part ending in "-05:00" will ...
0
votes
0
answers
48
views
How to serialize DateTimeOffset value to UTC format using Newtonsoft Json [duplicate]
Is it possible to serialize the DateTimeOffset as UTC format using Newtonsoft Json?
While using the following method, DateTime is property getting serialized to UTC but DateTimeOffset is not.
I know ...