score:1
first of all, new datetime()
returns a value that can be displayed as 1/1/0001 12:00:00 am (source: https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0). pretty much year, month, day, hour, minute, second set to 0. also, it is returned without specified timezone (local or utc), thus converting it to utc does nothing.
var date = new datetime();
console.writeline(date);
console.writeline(date.touniversaltime());
// output
01/01/0001 00:00:00
01/01/0001 00:00:00
because of that, your date will definetly be off. if you are sure, that item.utcstarttime
contains correct utc time, add it to today's date, can be done with:
var utctimetoday = datetime.utcnow.date.add(item.utcstarttime);
Source: stackoverflow.com
Related Query
- To get the date difference between a datetime and nullable datetime
- How to get regional timezone on Compact Framework and then convert UTC date to local date?
- How to Get Date from SQL server and store it in SQL Database in single query
- Get date and time from server
- How to get DateTime with a UTC datetime and a particular timezone?
- C# - Get date difference of Nullable DateTime in int
- Is there any function for UTC to convert to particular datetime to UTC date time
- Calculation with DateTime and TimeSpan in C#
- C#: Get All Files From a Specific Date and Save It To a Folder
- Is there a class that holds both dateTime and Timespan together?
- C# Adding years and days in a single DateTime variable
- How Do I insert Date and Time into SQL Server database in certain format?
- Adding Null Value To DATE Field In SQL SERVER
- Get local DateTime in Denmark from server in Ireland
- DateTime.Date get me Date and 12:00 AM
- Convert string to datetime and remove the time part from the date
- Using DateTime and TimeSpan with non-365 day years
- Watin : Get Datetime and perform calculation
- Get SQL query from user and run it against SQL Server
- How do I retrieve the date and time from DateTime string
- Handling time-zone between client and server for date-only DateTime
- How can i get the same value for round method in c# and SQL server
- Compare DateTime and date as string
- Get datetime filteration rows in SQL by using month and year
- Format DateTime List to show only date and no time
- Get full date when DateTime.DayOfYear and Year is given
- ASP.NET C# Get retrieve and show image from SQL Server database
- How I get a positive TimeSpan If the second DateTime is bigger then the first?
- c# linq how to declare in SQL Server and save date and time separately
- how to get server machine date in winform?
More Query from same tag
- Writing out properties specific to a Derived Class
- How to add listener to UnityEvent in prefab programatically
- Enforce one instance of an application winform c#
- Nested JSON data to datatable dynamically C#
- MS test, trying to insert my test name into test Capabilities
- Unity C# how to make one variable equal another without using static keyword
- Stopping the flow of program until the user has entered text(c#)
- Ambiguous reference CS0104: 'Debug' is an ambiguous reference between'UnityEngine.Debug' and 'System.Diagnostics.Debug'
- One process uses two ports
- How to dynamically correct a TextBox's Input Validation as soon as it loses focus?
- C# Recolored Image Pixelated
- how to integrate two classes
- C# Determine 20% of a dollar amount, result as decimal
- Regex to parse FTP server list C#
- Cannot convert from 'string[]' to 'string'
- Can switch case being used like a void method?
- Telegram Bot C# - Send object Bitmap
- Save Checked Boxes C#
- Filtering a list using Find All with an OR statement
- Accessing element of a List. C#
- How to fix (the operation has timed out) error in sending emails using SMTP?
- use internal class in public method
- How do I use ZXing.Net scanner in Xamarin forms alongside other UI elements?
- Unity 2D how to make instantiated object fly to some other object
- Why is Parallel.ForEach loop only doing a shallow copy?
- Is it normal for Page_Load to trigger upon clicking a page of a GridView inside an UpdatePanel?
- Why is "[FromBody]string json" null when coming from Postman?
- Search a sentence in a string (C#)
- TDD List Functionality
- Adding a value to a listbox item. C#