Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static int toM(long time) {
        Date dat = new Date(time);
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(dat);
        java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("mm");
        String sb = format.format(gc.getTime());
        int i = Integer.parseInt(sb);
        return i;

    }
}