Here you can find the source of getTimestamp()
public static String getTimestamp()
//package com.java2s; /******************************************************************************* * Copyright (c) 2014//w w w .java 2 s .c o m * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Benjamin Klatt - initial API and implementation and/or initial documentation *******************************************************************************/ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * Get the current human readable timestamp. For example, to be used in * logging. * * @return The string representation of the timestamp. */ public static String getTimestamp() { /** The date format to use in job logging etc. */ DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss:S"); return (dateFormat.format(new Date())); } }