Java Date to Time getTimeByCustomPattern(Date date, String pattern)

Here you can find the source of getTimeByCustomPattern(Date date, String pattern)

Description

get Time By Custom Pattern

License

Open Source License

Declaration

public static String getTimeByCustomPattern(Date date, String pattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getTimeByCustomPattern(Date date, String pattern) {
        return new SimpleDateFormat(pattern).format(date);
    }/*from  w w  w .  j  a  v a2 s . c om*/
}

Related

  1. getTimeAsMilliSeconds(Date dateTime)
  2. getTimeAsString(Date date)
  3. getTimeAsXsdDateTime(Date d)
  4. getTimeBackInMillis(final int granularity, final int numberToBack, final Date date)
  5. getTimeBoxValue(TimeZone zone, Date date)
  6. getTimeByOffset(Date reqDate, int offset)
  7. getTimeDateByMinuteAndSeconds( Integer minutes, Integer seconds)
  8. getTimeDateStr(Date date)
  9. getTimeDeltaValue(Date t, Date baseDate, String tDelta)