Here you can find the source of timeToString(long timestamp, SimpleDateFormat format)
public static String timeToString(long timestamp, SimpleDateFormat format)
//package com.java2s; /*// w ww . j a v a 2 s. c o m * Title: StorageCloudSim * Description: StorageCloudSim (Storage as a Service Cloud Simulation), an extension for CloudSim * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2013, Karlsruhe Institute of Technology, Germany * https://github.com/toebbel/StorageCloudSim * http://www.tobiassturm.de/projects/storagecloudsim.html */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static SimpleDateFormat defaultDateFormat = new SimpleDateFormat("hh:mm:ss:S"); public static String timeToString(long timestamp) { return timeToString(timestamp, defaultDateFormat); } public static String timeToString(long timestamp, SimpleDateFormat format) { return format.format(new Date(timestamp)); } }