Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8409295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:52:09+00:00 2026-06-09T23:52:09+00:00

I had a string in config file, defining date time with time zone. I

  • 0

I had a string in config file, defining date time with time zone.
I am not able to get this value, while reading values from config file.

In config file:

Setting name="abcdefgh" value="2012-08-10T22:00:00-08:00"

In C#, I am reading this as follows:

 DateTime StartDate;

 StartDate = DateTime.ParseExact(RoleEnvironment.GetConfigurationSettingValue("abcdefgh"), "yyyy-MM-dd HH:mm:ss", null);
            Configuration.Instance.abcdefgh= StartDate;

In start date, i am getting 11 Aug, 2012 11:30:00, with no time zone.

I want to read it as it is. also tell, if my format of writing datetime in config file is correct

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:52:10+00:00Added an answer on June 9, 2026 at 11:52 pm

    MSDN link to DateTimeOffset.

    Use DateTimeOffset whenever you are referring to an exact point in
    time. For example, use it to calculate “now”, transaction times, file
    change times, logging event times, etc. If the time zone is not
    known, use it with UTC. These uses are much more common than the
    scenarios where DateTime is preferred, so this should be considered
    the default.

    var date = DateTimeOffset.Parse("2012-08-10T22:00:00-08:00");
    date.Offset // -08:00:00,  offset from Coordinated Universal Time (UTC)
    date.DateTime // 10/08/2012 22:00:00, 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a Scala class as follows: class ClassA(val name: String) { println(this is
For this assignment I had to create my own string class. I initially wrote
This might sound a bit dumb. I always had this impression that web.config should
Hi I am a novice in JAVA. I have been getting this file not
I've just started learning C# and had created this simple configuration file generator for
Suppose I had a string for example: >>> stri = "日本" >>> res =
So lets say I had a string that was <html> <head><title>301 Moved Permanently</title><head> and
I had the impression that Class.forName(String className) used the Thread.currentThread().getContextClassLoader() to load the class
I had a class: public class Constant { public static string ConnString = ConfigurationManager.ConnectionStrings[ConnString].ConnectionString;
I had some code that ran commands through Runtime.getRuntime.exec(String) , and it worked on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.