Syntax:
set timefmt "<format string>" show timefmt
The string argument tells gnuplot how to read timedata from the datafile. The valid formats are:
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 |
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.
Since gnuplot cannot read non-numerical text, 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: see set format for more details about these and other options for printing timedata. (gnuplot will determine the proper month and weekday from the numerical values.)
See also set xdata and Time/date for more information.
Example:
set timefmt "%d/%m/%Y\t%H:%M"tells gnuplot to read date and time separated by tab. (But look closely at your data — what began as a tab may have been converted to spaces somewhere along the line; the format string must match what is actually in the file.)