To plot a data file which contains date or time, you need to tell
gnuplot that the data are date/time type by the command set
xdata time or set ydata time , then specify the
data file format by set timefmt . Let's begin with the
following example:

When gnuplot reads in date/time type data as X-axis data, it
generates appropriate X-tics automatically. In the example above,
which are time sequence data for one week, gnuplot writes
"month/day" on the X-axis, plus time of "00:00" which we may not
need. To control the output format, use set format .
This format specification not the same as usual numerical output, but it is a
format for the strftime function of UNIX library.

gnuplot> set xdata time
gnuplot> set timefmt "%Y-%m-%d"
gnuplot> set format x "%b/%a"
gnuplot> plot "sample.dat" using 1:2 with boxes

In addition to the format-characters shown above, you can use "%a"
which does not exist in timefmt . With the "%a" format
gnuplot gives you a weekday name. See manual of strftime function
in detail. Anyway, formats such as "Y, y, m, d, H, M, S" are
probably enough for almost all cases.