Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Date;

public class Main {
    public static String timeToReadableString(Date date) {
        String returned = "";
        if (date.getHours() < 10)
            returned += "0" + date.getHours();
        else
            returned += date.getHours();
        returned += ":";
        if (date.getMinutes() < 10)
            returned += "0" + date.getMinutes();
        else
            returned += date.getMinutes();
        return returned;
    }
}