[SWLUG] using 'date' with british summer time

bascule asura at theexcession.co.uk
Thu Nov 27 21:47:13 UTC 2003


i have a little script that renames files from my camera according to their 
timestamps (attached), i usually delete them from my camera once done but i 
just now ran the script on some new files and saw that i had left some old 
files on the memory card, i was surprised to see that the old files were 
renamed an hour later than the last time they were processed, i note that 
these old files were created before the recent clock changes, this seems an 
obvious candidate for the discrepancy, but examining my script i can't see 
where the deviation from UTC occurs, or rather, i can understand if the 
'date' command formats it's output according to local timezones but why would 
it change its format for the same date just because the date the command is 
run is after a daylight savings change, or is 'date' completely daylight 
savings unaware and just assumes that i am now in a different timezone?
can someone suggest an alteration to force UTC output from 'date', the only 
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

bascule
-- 
Too many people want to *have written*.
(alt.fan.pratchett)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: photorename
Type: application/x-shellscript
Size: 682 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/swlug/attachments/20031127/64a87920/attachment.bin>


More information about the Swlug mailing list