Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
Spring Jaxb2Marshaller - Date issue

I am seeing a curious thing happening when deserializing an XML response into a POJO object, specifically a date field. Here are the details:

  • The date field is represented as a long value when serializing/deserializing. The long value is supposed to be the time in millis since epoch (1970).
  • It is happening only for old dates (before 1970) where the long value is actually negative
  • The issue is that during deserialization, the negative long value is parsed into a date object with an additional offset
  • For example, if the actual value is:
    • -1570341200000
    • which is, 29/03/1920, 00:00:00 GMT+5:30
  • The date object that is deseralized gets mapped to:
    • -1570339800000
    • which is, 29/03/1920, 00:23:20 GMT+5:30
  • As you can see, the deserialized date is off by +1400 seconds.
  • The marshaller that is being used is:
    • org.springframework.oxm.jaxb.Jaxb2Marshaller

Is there some default configuration at the client side which is making the deserialization off?

I am not familiar with JAXB, so please feel free and let me know if you need any additional information.

Thanks,

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda