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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:57:14+00:00 2026-06-15T18:57:14+00:00

I’m working with FlexJSON and am having trouble parsing a Date object from an

  • 0

I’m working with FlexJSON and am having trouble parsing a Date object from an int. I’m trying to use the JSONDeserializer like so:

String json = decryptJson(new String(personalInformationData));
return new JSONDeserializer<PersonalInformation>().deserialize(json);

And the value of json is:

{"address1":"123 Fake St","address2":"#4","address3":"","city":"Springfield","class":"PersonalInformation","confirmEmailAddress":"foo@bar.com","coverageGroupName":"","coverageGroupNumber":"","coverageType":"I","dob":21600000,"emailAddress":"foo@bar.com","firstName":"Zapp","formOfId":"D","group":false,"idNum":"K201132083220","idState":"AL","individual":true,"lastName":"Brannigan","middleInitial":"","nonUsAddress":false,"nonUsAddress1":null,"nonUsAddress2":null,"nonUsAddress3":null,"phone":"(555) 555-5555","ssn":"555555555","state":"OH","zip":"55555"}

Everything is parsed correctly unless the date of birth (dob key) value is between December 7th, 1969 and January 25th, 1970 (or -2138400000 to 2095200000 in milliseconds), then FlexJSON throws this error:

[JSONException: [ dob ]: Parsing date 21600000 was not recognized as a date format]

I’m not sure how this is happening because new Date(21600000) evaluates to Thu Jan 01 00:00:00 CST 1970.

Has anyone encountered this?


Update #1


So it appears that this error is happening because JSONDeserializer can’t handle dates saved as a Unix TimeStamp that are in the range of Dec. 7th, 1969 through Jan. 25th, 1970. Any other date outside of that range is accepted and is also a Unix TimeStamp.

I don’t think that I need to implement a custom ObjectFactory with .use() or create a custom Transformer because other Unix TimeStamps work that aren’t in the failing date range.


Update #2


I tried implementing a transformer upon serialization to change the date from a Unix TimeStamp to a date formatted string using:

String json = new JSONSerializer().transform(new DateTransformer("yyyy-caMM-dd"), "dob").serialize(personalInformation);

That worked exactly how it was supposed to but not upon deserialization. I’m still getting the same error:

[JSONException: [ dob ]: Parsing date 1970-01-01 was not recognized as a date format]
  • 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-15T18:57:15+00:00Added an answer on June 15, 2026 at 6:57 pm

    Well it’s definitely a problem with Flexjson. We still weren’t able to figure out the problem but my coworker managed to come up with a work-around until it’s fixed. Essentially we create a new DateTransformer and designate a format to use. We then use that transformer to transform the Date.class upon serialization and make use of the transformer again with use() upon deserialization.

    The DateTransformer:

    private static final DateTransformer DATE_TRANSFORMER = new DateTransformer("MM/dd/yyyy");
    

    Serialization:

    String json = new JSONSerializer().transform(DATE_TRANSFORMER, Date.class).serialize(personalInformation);
    

    Deserialization:

    return new JSONDeserializer<PersonalInformation>().use(Date.class, DATE_TRANSFORMER).deserialize(json);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.