home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.suse      Suse is actually not that bad      138,051 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 137,406 of 138,051   
   marrgol to Paul R Schmidtbleicher   
   Re: UTC Time Stamps For Files on Flash D   
   03 Dec 21 00:51:12   
   
   From: marrgol@address.invalid   
      
   On 02/12/2021 at 20.06, Paul R Schmidtbleicher wrote:   
   > Yes, use 'time_offset=minutes' mount option when mounting a flashdrive.   
   >   I think it's time_offset=-480 in your case…   
   >   
   > OK, I used the following command:   
   >    
   >    The flash drive is mounted on /mnt   
   >    The files saved under Win 10 at 12:08 local time (PST) still read 4:08am   
   >    I.E. No change   
   > A file saved to this flashdrive at 10:58 PST reads on Win10 6:58pm   
   >    I.E. No change   
   > Maybe I am doing this wrong??   
      
   Don't know, works for me just fine…  Here's exactly how I tested it:   
   I made sure Windows (8.1 as I don't have 10 available at this   
   moment) timezone is set to '(UTC-08:00) Pacific Time (US & Canada)'   
   and the time is set correctly.  Then I mounted a flashdrive, created   
   a file named z.txt and safely removed the drive.  This was at 15:40   
   (3:40pm) PST.  Then I opened a terminal window in linux and did this   
   (as root):   
      
   ~ # # I made sure here I was working in the PST timezone too:   
   ~ # export TZ='America/Los_Angeles'   
   ~ # date +"%Z %z"   
   PST -0800   
   ~ # date   
   Thu Dec  2 15:40:55 PST 2021   
   ~ # # I mounted the flashdisk with time_offset:   
   ~ # mount -t vfat -o time_offset=-480 /dev/sdg1 /mnt   
   ~ # ls -l /mnt/z.txt   
   -rwxr-xr-x 1 root root 0 Dec  2 15:40 /mnt/z.txt   
   ~ # # The timestamp shown was the same as in Windows   
   ~ # # Then I created a file in linux:   
   ~ # touch /mnt/y.txt   
   ~ # ls -l /mnt/{z,y}.txt   
   -rwxr-xr-x 1 root root 0 Dec  2 15:41 /mnt/y.txt   
   -rwxr-xr-x 1 root root 0 Dec  2 15:40 /mnt/z.txt   
   ~ # umount /mnt   
   ~ # # Then I mounted the flash 'normally' to make sure the files'   
   ~ # # timestamps are indeed in UTC:   
   ~ # mount -t vfat /dev/sdg1 /mnt   
   ~ # TZ=UTC ls -l /mnt/{z,y}.txt   
   -rwxr-xr-x 1 root root 0 Dec  2 15:41 /mnt/y.txt   
   -rwxr-xr-x 1 root root 0 Dec  2 15:40 /mnt/z.txt   
   ~ # umount /mnt   
   ~ #   
      
   Then I went back to Windows to confirm that y.txt created   
   in linux had the timestamp of 15:41, which of course it did.   
   Try to reproduce these steps.  Maybe you don't have those   
   timezones set up correctly everywhere.   
      
      
   --   
   mrg   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca