Код: Выделить всё
$ touch testfile.txt
$ stat testfile.txt
File: `testfile.txt'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fc01h/64513d Inode: 3413533 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ me) Gid: ( 1000/ me)
Access: 2014-09-17 18:38:34.248965866 -0400
Modify: 2014-09-17 18:38:34.248965866 -0400
Change: 2014-09-17 18:38:34.248965866 -0400
Birth: -
$ date -d '2014-09-17 18:38:34.248965866 -0400' +%s
1410993514
Я могу передать число с плавающей запятой следующим образом:< /p>
Код: Выделить всё
>>> os.utime('testfile.txt', (1410993514.248965866, 1410993514.248965866))
Код: Выделить всё
$ stat testfile.txt
File: `testfile.txt'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fc01h/64513d Inode: 3413533 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ me) Gid: ( 1000/ me)
Access: 2014-09-17 18:38:34.248965000 -0400
Modify: 2014-09-17 18:38:34.248965000 -0400
Change: 2014-09-17 18:46:07.544974140 -0400
Birth: -
Есть ли способ установить полное поле микросекунд через Python?
Подробнее здесь: https://stackoverflow.com/questions/259 ... -in-python