<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Timefmt</TITLE> <META NAME="description" CONTENT="Timefmt"> <META NAME="keywords" CONTENT="gnuplot"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="gnuplot.css"> <LINK REL="next" HREF="node279.html"> <LINK REL="previous" HREF="node277.html"> <LINK REL="up" HREF="node175.html"> <LINK REL="next" HREF="node279.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html5199" HREF="node279.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html5193" HREF="node175.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html5187" HREF="node277.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html5195" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html5197" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html5200" HREF="node279.html">Title</A> <B> Up:</B> <A NAME="tex2html5194" HREF="node175.html">Set-show</A> <B> Previous:</B> <A NAME="tex2html5188" HREF="node277.html">Timestamp</A> <B> <A NAME="tex2html5196" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html5198" HREF="node467.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION0402470000000000000000"></A> <A NAME="commands_set_timefmt"></A><A NAME="commands_show_timefmt"></A><A NAME="set_timefmt"></A><A NAME="show_timefmt"></A><A NAME="timefmt"></A><A NAME="6626"></A> <BR> Timefmt </H2> This command applies to timeseries where data are composed of dates/times. It has no meaning unless the command <B>set xdata time</B> is given also. <P> Syntax: <BR> <PRE> set timefmt "<format string>" show timefmt </PRE> <BR> <P> The string argument tells <B>gnuplot</B> how to read timedata from the datafile. The valid formats are: <P> <DIV ALIGN="CENTER"> <TABLE CELLPADDING=3 BORDER="1"> <TR><TD ALIGN="CENTER" COLSPAN=2>Time Series timedata Format Specifiers</TD> </TR> <TR><TD ALIGN="CENTER">Format</TD> <TD ALIGN="LEFT">Explanation</TD> </TR> <TR><TD ALIGN="CENTER"><code>%d</code></TD> <TD ALIGN="LEFT">day of the month, 1-31</TD> </TR> <TR><TD ALIGN="CENTER"><code>%m</code></TD> <TD ALIGN="LEFT">month of the year, 1-12</TD> </TR> <TR><TD ALIGN="CENTER"><code>%y</code></TD> <TD ALIGN="LEFT">year, 0-99</TD> </TR> <TR><TD ALIGN="CENTER"><code>%Y</code></TD> <TD ALIGN="LEFT">year, 4-digit</TD> </TR> <TR><TD ALIGN="CENTER"><code>%j</code></TD> <TD ALIGN="LEFT">day of the year, 1-365</TD> </TR> <TR><TD ALIGN="CENTER"><code>%H</code></TD> <TD ALIGN="LEFT">hour, 0-24</TD> </TR> <TR><TD ALIGN="CENTER"><code>%M</code></TD> <TD ALIGN="LEFT">minute, 0-60</TD> </TR> <TR><TD ALIGN="CENTER"><code>%s</code></TD> <TD ALIGN="LEFT">seconds since the Unix epoch (1970-01-01 00:00 UTC)</TD> </TR> <TR><TD ALIGN="CENTER"><code>%S</code></TD> <TD ALIGN="LEFT">second, 0-60</TD> </TR> <TR><TD ALIGN="CENTER"><code>%b</code></TD> <TD ALIGN="LEFT">three-character abbreviation of the name of the month</TD> </TR> <TR><TD ALIGN="CENTER"><code>%B</code></TD> <TD ALIGN="LEFT">name of the month</TD> </TR> </TABLE> </DIV> Any character is allowed in the string, but must match exactly. 2#2t (tab) is recognized. Backslash-octals (2#2nnn) are converted to char. If there is no separating character between the time/date elements, then %d, %m, %y, %H, %M and %S read two digits each, %Y reads four digits and %j reads three digits. %b requires three characters, and %B requires as many as it needs. <P> Spaces are treated slightly differently. A space in the string stands for zero or more whitespace characters in the file. That is, <TT>"</TT>%H %M<TT>"</TT> can be used to read <TT>"</TT>1220<TT>"</TT> and <TT>"</TT>12 20<TT>"</TT> as well as <TT>"</TT>12 20<TT>"</TT>. <P> Each set of non-blank characters in the timedata counts as one column in the <B>using n:n</B> specification. Thus <B>11:11 25/12/76 21.0</B> consists of three columns. To avoid confusion, <B>gnuplot</B> requires that you provide a complete <B>using</B> specification if your file contains timedata. <P> Since <B>gnuplot</B> 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 <TT>"</TT>%a<TT>"</TT>, <TT>"</TT>%A<TT>"</TT>, <TT>"</TT>%b<TT>"</TT>, or <TT>"</TT>%B<TT>"</TT> specifier: see <B>set format (p. <A HREF="node206.html#set_format"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="6661"></A></B> for more details about these and other options for printing timedata. (<B>gnuplot</B> will determine the proper month and weekday from the numerical values.) <P> See also <B>set xdata (p. <A HREF="node295.html#set_xdata"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="6664"></A></B> and <B>Time/date (p. <A HREF="node54.html#Time_date"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>)<A NAME="6666"></A></B> for more information. <P> Example: <BR> <PRE> set timefmt "%d/%m/%Y\t%H:%M" </PRE> <BR> tells <B>gnuplot</B> 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.) See also <P> http://www.gnuplot.info/demo/timedat.html<TT>time data demo. </TT> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html5199" HREF="node279.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html5193" HREF="node175.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html5187" HREF="node277.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html5195" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html5197" HREF="node467.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html5200" HREF="node279.html">Title</A> <B> Up:</B> <A NAME="tex2html5194" HREF="node175.html">Set-show</A> <B> Previous:</B> <A NAME="tex2html5188" HREF="node277.html">Timestamp</A> <B> <A NAME="tex2html5196" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html5198" HREF="node467.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2010-08-17 </ADDRESS> </BODY> </HTML>