Here you can find the source of dateToMillis(Date date)
public static final String dateToMillis(Date date)
//package com.java2s; import java.util.*; public class Main { private static final char[] zeroArray = "0000000000".toCharArray(); /**// w w w . j ava 2 s . co m * Formats a Date as a fifteen character long String made up of the Date's * padded millisecond value. */ public static final String dateToMillis(Date date) { return zeroPadString(Long.toString(date.getTime()), 15); } public static final String zeroPadString(String string, int length) { if (string == null || string.length() > length) { return string; } StringBuilder buf = new StringBuilder(length); buf.append(zeroArray, 0, length - string.length()).append(string); return buf.toString(); } }