Here you can find the source of getCurrentTimestampString()
public static String getCurrentTimestampString()
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat SIMPLE_DATE_FORMATTER1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); /**// ww w . j a v a2 s . c om * Gets the current date and time in a readable format for logging. * * @return The formatted date time string */ public static String getCurrentTimestampString() { return SIMPLE_DATE_FORMATTER1.format(new Date()); } }