From: <and...@us...> - 2009-02-03 13:45:23
|
Revision: 9443 http://plplot.svn.sourceforge.net/plplot/?rev=9443&view=rev Author: andrewross Date: 2009-02-03 13:45:19 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Replace call to strftime in plbox with equivalent call to qsastime library. For now everything else is unchanged. Eventually there will be more routines for time handling. This should now work consistently across all platforms. Modified Paths: -------------- trunk/src/plbox.c Modified: trunk/src/plbox.c =================================================================== --- trunk/src/plbox.c 2009-02-03 12:35:31 UTC (rev 9442) +++ trunk/src/plbox.c 2009-02-03 13:45:19 UTC (rev 9443) @@ -23,6 +23,7 @@ */ #include "plplotP.h" +#include "../lib/qsastime/MJDtime.h" static PLFLT xlog[8] = { @@ -1199,8 +1200,8 @@ PLFLT pos, tn, tp, offset, height; PLFLT factor, tstart; const char *timefmt; - struct tm *tm; - time_t t; + MJDtime tm; + double t; /* Set plot options from input */ @@ -1246,9 +1247,9 @@ tp = xtick1 * (1. + floor(vpwxmi / xtick1)); for (tn = tp; BETW(tn, vpwxmi, vpwxma); tn += xtick1) { if (ldx) { - t = (time_t) tn; - tm = gmtime(&t); - strftime(string, 40, timefmt, tm); + t = (double) tn; + setFromUT(1970,1,1,0,0,t,&tm,0); + strfMJD(string, 40, timefmt, &tm, 0); } else { plform(tn, xscale, xprec, string, llx, lfx); @@ -1295,9 +1296,9 @@ tp = ytick1 * (1. + floor(vpwymi / ytick1)); for (tn = tp; BETW(tn, vpwymi, vpwyma); tn += ytick1) { if (ldy) { - t = (time_t) tn; - tm = gmtime(&t); - strftime(string, 40, timefmt, tm); + t = (double) tn; + setFromUT(1970,1,1,0,0,t,&tm,0); + strfMJD(string, 40, timefmt, &tm, 0); } else { plform(tn, yscale, yprec, string, lly, lfy); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |