Java Timestamp Create getTimeStamp()

Here you can find the source of getTimeStamp()

Description

get Time Stamp

License

Open Source License

Declaration

public static final String getTimeStamp() 

Method Source Code

//package com.java2s;
/* *********************************************************************** *
 * project: org.matsim.*/* w  ww.j a  v a  2s . c o m*/
 * UCSBUtils.java
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 * copyright       : (C) 2011 by the members listed in the COPYING,        *
 *                   LICENSE and WARRANTY file.                            *
 * email           : info at matsim dot org                                *
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *   See also COPYING, LICENSE and WARRANTY file                           *
 *                                                                         *
 * *********************************************************************** */

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {
    public static final String getTimeStamp() {
        Calendar today = new GregorianCalendar();
        SimpleDateFormat df = new SimpleDateFormat();
        df.applyPattern("yyyyMMDD_HHMMss");
        return df.format(today.getTime());
    }
}

Related

  1. getTimeStamp()
  2. getTimestamp()
  3. getTimeStamp()
  4. getTimestamp()
  5. getTimestamp()
  6. getTimeStamp()
  7. getTimestamp()
  8. getTimestamp()
  9. getTimeStamp()