C# datetime.now gives past time

Jey 1 Reputation point
2021-09-23T11:59:19.41+00:00

hello there, i have 2 separate projects. when i run the below code from Project1 then it gives me the same time of my laptop time; when i run the same code from another project then it gives 2 hours old time only.

for example, project1 gives time as "13:52" whereas project2 gives time as "11:52". May I know how this different comes and how to resovlve ig?

DateTime now = DateTime.Now().ToString("HH:mm:ss")

thank you

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,128 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.