skip to Main Content

Json Deserialization of string "2023-11-10 23:01:18.940" to calendar

I am trying to deserialize json String date to Calendar and deserialization is working however it is not what i want. Current Behaviour @JsonProperty("systemDt") @JsonFormat(Pattern="yyyy-MM-dd HH:mm:ss.SSS") Calendar responseDateTime; Deserializes to responseDateTime=java.util.GregorianCalendar[time=1141556400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="UTC"...... I want a Simple Calendar Date of the format…

VIEW QUESTION

Javascript – How to validate a date string using date-fns

I'm trying to validate a user input for a datetime using date-fns: import { isDate, isValid } from 'date-fns'; console.log('DATE:', stringVal); console.log('IS_DATE:', isDate(new Date(stringVal))); console.log('IS_VALID:', isValid(new Date(stringVal))); This produces: DATE: 2023-02-31 03:03:03 IS_DATE: true IS_VALID: true This seems to be…

VIEW QUESTION
Back To Top
Search