Syntax:
set timefmt "<format string>" show timefmt
The string argument tells gnuplot how to read timedata from the datafile. The valid formats are:
Time Series timedata Format Specifiers | |
Format | Explanation |
%d |
day of the month, 1-31 |
%m |
month of the year, 1-12 |
%y |
year, 0-99 |
%Y |
year, 4-digit |
%j |
day of the year, 1-365 |
%H |
hour, 0-24 |
%M |
minute, 0-60 |
%s |
seconds since the Unix epoch (1970-01-01 00:00 UTC) |
%S |
second, 0-60 |
%b |
three-character abbreviation of the name of the month |
%B |
name of the month |
Spaces are treated slightly differently. A space in the string stands for zero or more whitespace characters in the file. That is, "%H %M" can be used to read "1220" and "12 20" as well as "12 20".
Each set of non-blank characters in the timedata counts as one column in the using n:n specification. Thus 11:11 25/12/76 21.0 consists of three columns. To avoid confusion, gnuplot requires that you provide a complete using specification if your file contains timedata.
If the date format includes the day or month in words, the format string must
exclude this text. But it can still be printed with the "%a", "%A", "%b", or
"%B" specifier. gnuplot will determine the proper month and weekday from the
numerical values. See set format (p. ) for more details about these and other
options for printing time data.
When reading two-digit years with %y, values 69-99 refer to the 20th century, while values 00-68 refer to the 21st century. NB: This is in accordance with the UNIX98 spec, but conventions vary widely and two-digit year values are inherently ambiguous.
See also set xdata (p. ) and Time/date (p.
) for more information.
Example:
set timefmt "%d/%m/%Y\t%H:%M"
http://www.gnuplot.info/demo/timedat.htmltime data demo.