Java Time Format getTimeInProvenanceFormat(Date date)

Here you can find the source of getTimeInProvenanceFormat(Date date)

Description

get Time In Provenance Format

License

Open Source License

Declaration

public static String getTimeInProvenanceFormat(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String getTimeInProvenanceFormat() {
        SimpleDateFormat sdf = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ssXXX");
        sdf.setTimeZone(TimeZone.getDefault());
        return sdf.format(new Date());
    }/*from w ww  .jav  a2s.  co  m*/

    public static String getTimeInProvenanceFormat(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ssXXX");
        sdf.setTimeZone(TimeZone.getDefault());
        return sdf.format(date);
    }
}

Related

  1. getTimeFormat(String format)
  2. getTimeFormatted()
  3. getTimeFormatter()
  4. getTimeFromString(String time, SimpleDateFormat formatter)
  5. getTimeFromString(String timeStr, String format)
  6. getTimeOnlyDateFormat()
  7. getTimeOnlyWithNumber()
  8. getTimeQuantum(String strDate, String format)
  9. getTimeStringFormatedForSWANWithDelim( final Object pObjTime, final String pStrDelim)