Here you can find the source of getFriendlyLocalDateTime(Date date)
Parameter | Description |
---|---|
date | to be parsed |
public static String getFriendlyLocalDateTime(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static final String friendlyDateFormat = "hh:mm a"; /**/*from www .j ava2 s. co m*/ * Return timestamp in human-readable form wrt local timezone * * @param date to be parsed * @return formatted timestamp */ public static String getFriendlyLocalDateTime(Date date) { final SimpleDateFormat sdf = new SimpleDateFormat( friendlyDateFormat); sdf.setTimeZone(TimeZone.getDefault()); return sdf.format(date); } }