Java Date Now getCurrentJnlpTimestamp()

Here you can find the source of getCurrentJnlpTimestamp()

Description

get Current Jnlp Timestamp

License

Apache License

Declaration

public static String getCurrentJnlpTimestamp() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static final String JNLP_TIMESTAMP_PREFIX = "TS: ";
    public static final String JNLP_TIMESTAMP_DATETIME_FORMAT = "YYYY-MM-DD hh:mm:ss";

    public static String getCurrentJnlpTimestamp() {
        return getJnlpTimestamp(new Date());
    }/*ww w.  java  2s .  co m*/

    public static String getJnlpTimestamp(Date date) {
        final SimpleDateFormat dateFormat = new SimpleDateFormat(JNLP_TIMESTAMP_DATETIME_FORMAT);

        return JNLP_TIMESTAMP_PREFIX + dateFormat.format(date);
    }
}

Related

  1. getCurrentDayInyyyyMMdd()
  2. getCurrentFormattedTime()
  3. getCurrentGMTTime()
  4. getCurrentHMS()
  5. getCurrentISO8601Date()
  6. getCurrentLastDate()
  7. getCurrentLocaleTime()
  8. getCurrentMinutes()
  9. getCurrentMonth()