Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.util.Calendar;

public class Main {

    public static String getfullTimeToStringMills(String timeString) {
        return String.valueOf(timeToMills(timeString));
    }

    public static long timeToMills(String timeString) {
        Calendar c = Calendar.getInstance();
        c.set(Integer.parseInt(timeString.substring(0, 4)), Integer.parseInt(timeString.substring(4, 6)) - 1,
                Integer.parseInt(timeString.substring(6, 8)), Integer.parseInt(timeString.substring(8, 10)),
                Integer.parseInt(timeString.substring(10, 12)), Integer.parseInt(timeString.substring(12, 14)));

        return c.getTimeInMillis();
    }
}