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 8341871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:36:45+00:00 2026-06-09T05:36:45+00:00

Here is the code: string s = 2012-08-08T01:54:45.3042880+00:00; JObject j1 = JObject.FromObject(new { time=s

  • 0

Here is the code:

        string s = "2012-08-08T01:54:45.3042880+00:00";

        JObject j1 = JObject.FromObject(new
        {
            time=s
        });

        Object o = j1["time"];

We can check that o is string and equals “2012-08-08T01:54:45.3042880+00:00”

Now we transfer j1.ToString() to another program, which is

       {
          "time": "2012-08-08T01:54:45.3042880+00:00"
       }

then at the other program, try to parse it back to JObject, which is

       JObject j2 = JObject.Parse(j1.ToString());

       Object o2 = j2["time"];

Now, if we check o2, o2’s type is Date, o2.ToString() is 8/7/2012 9:54:45 PM.

My question is:

Is there is way to disable the Date deserialization for JObject.Parse , and just get the raw string?

Thanks in advance

  • 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-09T05:36:46+00:00Added an answer on June 9, 2026 at 5:36 am

    When parsing from an object to JObject you can specify a JsonSerializer which instructs how to handle dates.

    JObject.FromObject(new { time = s },
                       new JsonSerializer {
                              DateParseHandling = DateParseHandling.None
                       });
    

    Unfortunately Parse doesn’t have this option, although it would make sense to have it. Looking at the source for Parse we can see that all it does is instantiate a JsonReader and then passes that to Load. JsonReader does have parsing options.

    You can achieve your desired result like this:

      using(JsonReader reader = new JsonTextReader(new StringReader(j1.ToString()))) {
        reader.DateParseHandling = DateParseHandling.None;
        JObject o = JObject.Load(reader);
      }
    

    For background, see Json.NET interprets and modifies ISO dates when deserializing to JObject #862, specifically this comment from JamesNK: I have no plans to change it, and I would do it again if give the chance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code: new Loading.LoadTast(ctx) { @Override protected String doInBackground(Integer... params) { Looper.prepare();
Here's the code: static void Main(string[] args) { Semaphore loadFinished = new Semaphore(0, 1);
I'm having trouble getting data from a ResultSet object. Here is my code: String
Here's the code: string name = myName; int id = (int)_myDB.ThingTable.Where(thing => thing.ThingName ==
Here is the code: string str; cin>>str; cout<<first input:<<str<<endl; getline(cin, str); cout<<line input:<<str<<endl; The
In the following code: public class A { public A():this(null){} public A(string b){/*code here*/}
I'm writing a lexer in haskell. Here's the code: lexer :: String -> [Token]
here is code for regular expression matching #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int
here is the code public static final String DATE_TIME_FORMAT = yyyy-MM-dd kk:mm:ss; public static
Here is my code : public static void main(String[] args) { // System.setProperty( //

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.