|
From: Daniel J S. <dan...@ie...> - 2010-12-29 18:45:15
|
Ethan Merritt wrote:
> On Wednesday, December 29, 2010, Juhász Péter wrote:
>
>>I've found it frustrating that there is
>>no way within gnuplot to get the current time, one has to resort to an
>>external application. There is already an extensive framework in place
>>for formatting date&time strings, there is even a way to put the current
>>time as a time stamp on the plot, but there is no way to get it as a
>>variable (for example). There ought to be a time() function that returns
>>the current gnuplot time (seconds since 2000), the existing formatting
>>functions are adequate to transform that into any other format.
>
>
> Sounds reasonable to me. The only concern I see is the question of
> whether it can be made totally portable, or whether it will need
> documentation as being system-dependent.
>
> As you noted before in a sample script, on unix-ish systems you can do
> time = system("date +%s")
> to get the number of seconds since the unix epoch. Maybe it would be
> sufficient to export a user variable containing the offset between
> system time and internal time?
> internal_time = system("date +%s") - GPVAL_EPOCH
> Nah. That would just confuse everyone.
Can't the C time routines in time.h be used somehow?
...
I'll have a follow up to the rand() seed discussion in a little while.
Dan
|