0

I have datetime in string format. What I need is to get the UTC format for the same datetime string so that I could send it on backend server. But also i need to send the correct UTC time means according to the time zone.

Example: I have a datetime string as "30-09-2016 22:10" now from this I need a UTC format. Since this datetime string is obtained from my app used in India, so the converted UTC format should be in correct form.

1
  • 2
    What is a UTC format? Commented Sep 25, 2016 at 19:34

1 Answer 1

0

When a DateTime is created in an app, usually it is DateTimeKind.Local, so you can just use the ToUniversalTime()method before you send it to your server.

If you have a string, just use DateTime.Parse, it would create a Local date time, which you can use like I explained above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.