Search code examples
androidparse-platformdate-format

How to get ParseObject's createdAt date as String?


How do I get the date from the ParseObject's createdAt column and convert it to a String in the DD-MM-YYYY format?


Solution

  • You need to get the date from Parse like this:

    Date date = object.getCreatedAt();
    

    And then in the adapter or wherever you want:

    DateFormat df = new SimpleDateFormat("dd-MM-yyyy");
    String reportDate = df.format(date);