Print a Timestamp

TIMESTAMP is a Python script which prints the current YMDHMS date (year-month-day-hours-minutes-seconds) as a timestamp.

This is useful when documenting the run of a program. By including a timestamp, the output of the program will always contain a clear indication of when it was created. Other indicators, such as the file modification timestamp, may be misleading or subject to unintentional modification.

TIMESTAMP simply gives the current time. If you are trying to do careful timings of the speed of execution of a computer code, this may not be very accurate, especially on a computer that uses timesharing.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


TIMESTAMP is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

TIMER, PYTHON programs which demonstrate how to compute CPU time or elapsed time.

WTIME, a PYTHON library which returns a reading of the wall clock time in seconds.

Source Code:

You can go up one level to the PYTHON source codes.

Last revised on 25 May 2011.