Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String readableDate(String dateString) {
        DateFormat input = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ");
        DateFormat output = new SimpleDateFormat("dd.MM.yyyy HH:mm");

        Date date = new Date();
        try {
            date = input.parse(dateString);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return output.format(date.getTime());
    }
}