Java Timestamp Create getTimeStamp(Date date)

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

Description

get Time Stamp

License

LGPL

Declaration

public static String getTimeStamp(Date date) 

Method Source Code

//package com.java2s;
/*//from w w  w.  j av  a 2s. c  o m
 * JLib - Publicitas Java library v1.2.0.
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA.
 * Licensed under LGPL (LGPL-LICENSE.txt) license.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private String format = "yyyy.MM.dd HH:mm:ss";

    public static String getTimeStamp() {
        Date date = new Date();
        return getTimeStamp(date);
    }

    public static String getTimeStamp(Date date) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
        String cs = formatter.format(date);
        return cs;
    }
}

Related

  1. getTimestamp()
  2. getTimestamp()
  3. getTimestamp()
  4. getTimestamp(Calendar time)
  5. getTimeStamp(Date date)
  6. getTimeStamp(Date date)
  7. getTimeStamp(Date date)
  8. getTimestamp(Date date)
  9. getTimestamp(Date date, String timestampPattern)