Here you can find the source of getDisplayableTimeStamp(Date timeStamp)
Parameter | Description |
---|---|
timeStamp | to format to a displayable string. |
public static String getDisplayableTimeStamp(Date timeStamp)
//package com.java2s; /**/*from w w w. j a v a 2 s . c o m*/ * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caintegrator/LICENSE.txt for details. */ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * String for timestamp if it is null. */ public static final String TIMESTAMP_UNAVAILABLE_STRING = "Unavailable"; private static final String TIMESTAMP_FORMAT = "MM/dd/yyyy HH:mm:ss"; /** * Used for all of the timestamps in caIntegrator2. * @param timeStamp to format to a displayable string. * @return displayable timestamp string. */ public static String getDisplayableTimeStamp(Date timeStamp) { return timeStamp == null ? TIMESTAMP_UNAVAILABLE_STRING : new SimpleDateFormat(TIMESTAMP_FORMAT, Locale.US).format(timeStamp); } }