[SWLUG] using 'date' with british summer time

Dick Porter dick at acm.org
Thu Nov 27 23:40:09 UTC 2003


On Thu, 2003-11-27 at 21:47, bascule wrote:
> can someone suggest an alteration to force UTC output from 'date', the only 

TZ=GMT date

> option i can see for this seems to refer to setting the date,
> as an example when i took photo in september and processed it immediately 
> after it was renamed to: 2003-09-05_23-25-16.avi
> but just now when i ran the script it was renamed to: 2003-09-06_00-25-16.avi
> the script runs from a temp directory holding a copy of the files on the 
> memory card

The filesystem stores times in (milli)seconds-since-whenever (whenever
depends on whether its a unix or dos filesystem.)  stat(1) reports the
times in local time, so the current effects of daylight savings will
influence the output.  You can see the same thing with ls -1, if you
look at the same file before and after the clocks change.

- Dick






More information about the Swlug mailing list