622 questions
0
votes
0
answers
78
views
Specify the time zone, not the offset, when creating a DATETIMEOFFSET value
Is it possible to specify the time zone rather than the offset when creating a DATETIMEOFFSET value from a string?
I know I can create a
DATETIMEOFFSET from a string which includes the time zone ...
1
vote
2
answers
90
views
What kind of DateTimeOffset does TriggerBuilder.StartAt expect?
Quartz.Net's TriggerBuilder.StartAt has in its signature the parameter DateTimeOffset startTimeUtc. Does the Utc mean that the Offset is expected to be zero? What if I passed a parameter with a local ...
0
votes
1
answer
146
views
Saving datetime offset in database
I currently have a problem with saving the UTC time. I have an application in which you can specify a timer for a job and this is then saved in the database. However, I have the following problem:
The ...
-3
votes
2
answers
160
views
Getting the +/- hour offset from SQL datetimeoffset [closed]
I am trying to parse the datetimeoffset. This is from a SQL Server database table's column that was created as datetimeoffset lengh=10, precision=34, scale=7
Example from one of the records: 2024-07-...
0
votes
0
answers
146
views
How to find to find 'today at midnight' in .NET?
We have a cron job scheduled at 'every day 3pm paris,' 'every day 3pm new york,' etc
In our code, the logic is to find all transactions realized between midnight and noon in the specified timezone
...
1
vote
0
answers
471
views
Handling dates and times between C# API and Typescript
I am having trouble correctly transporting my date and timezone to my backend. I am using a DateTimeOffset in the backend and a TypeScript date in the frontend. I attempted to convert the date to the ...
1
vote
1
answer
253
views
Check if DatetimeOffset is between 10 PM (today) and 2 AM (next day)
Below is the code that I have to check if currentDateInCST is between 10 PM and 2 AM (next day) in Central Standard Time. How do I make the startDate and endDate to be Central Standard Time ?
public ...
3
votes
3
answers
964
views
How to get specific time of tomorrow's date in datetimeoffset in c#?
I want a DateTimeOffset value for tomorrow's date, 7 AM , Central Standard Time.
My current code is:
var tomorrow = DateTime.Now.AddDays(1);
var tomorrowDate = new DateTime(tomorrow.Year, tomorrow....
1
vote
1
answer
80
views
Time Zone Related Issue
I have a scenario where I have to activate/deactivate a link based on the times assigned. Here a hotel needs to activate the link 48 hours before check-in (15:00 PM) and deactivate the same 5 hours ...
0
votes
1
answer
360
views
Is DateTimeOffset.MaxValue.ToUnixTimeMilliseconds() stable?
I am trying to use DateTimeOffset.MaxValue.ToUnixTimeMilliseconds() (which is 253402300799999) to designate a maximum value for some data.
This time basically represents "never" or that it ...
-1
votes
1
answer
225
views
I am getting error while update-database command to make tables related to Identity. column parameter or variable:cannot find data type datetimeoffset
I try to update the database to make tables related to Identity, and I'm using Microsoft.AspNetCore.Identity, autogenerated public class IdentityUser, when I write the command, I recieve this error:
...
1
vote
2
answers
1k
views
Check if a string representing a datetime includes a timezone
I'd like to parse a string to an object representing a timestamp, but I'm having some trouble adding the right timezone to it.
Specifically, when parsing, I can't find a way to make a distinction ...
0
votes
0
answers
144
views
Final epoch is 3 days ahead of the actual time given as input [duplicate]
My epoch value is 3 days ahead of the actual time passed as input.
I have a date 2023-03-21T04:34:12.234567800Z in which 00Z is the offset, but once I convert it to epoch in java, I am getting an ...
-1
votes
1
answer
486
views
How to convert date string which contains time offset to another format? [duplicate]
I'm receiving this kind of string as date "2020-09-09T12:41:41 -04:00".
It seems like this string contains time offset.
I need to convert this to "3/15/2020, 1:23:09 PM " format.
...
1
vote
1
answer
405
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 ...
0
votes
1
answer
881
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
0
answers
214
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
0
answers
346
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
1
answer
167
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="...
-1
votes
1
answer
75
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); ...
2
votes
4
answers
2k
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 ...
1
vote
1
answer
753
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 ...
0
votes
1
answer
165
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
75
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 ...
0
votes
0
answers
722
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 ...