Search code examples
javajsonhttpserverresponse

Date format used for json


I found a date format looks like 'creationDate:1509966414000' for an application for saving the creation date of an object in HTTP response. I am unable to parse this date format to real date, So guys could anyone help me to find out the architecture for creating this type of date format?


Solution

  • Just use Date(long date).

    public class MilliSecondToDate {
        public static void main(String[] args) {
            long milliSecond = 1509966414000L;
            Date date = new Date(milliSecond);
            System.out.println(date);
        }
    }