Java Timestamp Create getTimeStampByFormat(String style)

Here you can find the source of getTimeStampByFormat(String style)

Description

get Time Stamp By Format

License

Apache License

Declaration

public static String getTimeStampByFormat(String style) 

Method Source Code


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

import java.text.DateFormat;

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

public class Main {

    public static String getTimeStampByFormat(String style) {
        DateFormat format = new SimpleDateFormat(style);
        return format.format(new Date());
    }/* ww  w  .  j a  va  2  s.  com*/
}

Related

  1. getTimestamp2()
  2. getTimeStampAsString(Timestamp formatTime)
  3. getTimestampAsString(Timestamp tsTimestamp)
  4. getTimestampAtMidnightForDaysAgo(int days)
  5. getTimestampBeforeMs(long someMs)
  6. getTimestampDate(long timestamp)
  7. getTimestampDate(Timestamp ts)
  8. getTimestampDateDotTime()
  9. getTimestampDiff(int n)