# How can I fix incorrect date info for a directory?

**URL:** <https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266>\
**Category:** ℹ️ Support\
**Tags:** files-accesscontrol-app\
**Created:** [July 26, 2020, 12:36pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266 "2020-07-26T12:36:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Feldmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michael_feldmann/32/27474_2.png) [@Michael\_Feldmann](https://help.nextcloud.com/u/Michael_Feldmann)\
**Post date:** [July 26, 2020, 12:36pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/1 "2020-07-26T12:36:45Z")

</div>

Hi community ,  
my nextcloud 17 stopped working, probably caused by a server overload. The result was that i got a PHP error message  
] [php7:error] [pid 21059] [client 2.244.66.235:63583] PHP Fatal error: DateTime::\_\_construct(): Timezone database is corrupt - this should _never_ happen! in /var/www/html/nextcloud/lib/public/AppFramework/Http/FileDisplayResponse.php on line 56

After restarting apache, nextcloud works again, but web access for one of the user directories shows a date and time far into the future (somewhere in the year 4500!) . This goes for only one of the many directories and subdirectories (at least I haven’t found any more 🤨 )  
The subdirectories beneath the one with the incorrect date show correct date and time infos. Physically, in the server data directory, everything looks correct.

So, it seems it is a problem of the nextcloud structure. Probably in one of the mysql tables there is this wrong date. Can someon point me to a possibe solution?

Thanks for reading  
MIke

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [July 26, 2020, 1:14pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/2 "2020-07-26T13:14:13Z")

</div>

Please check the directory date on the console using the stat command. If this is ok, you can use the `occ files:scan ...`command to update the database.

---

<div class="post-metadata">

**Author:** ![Michael\_Feldmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michael_feldmann/32/27474_2.png) [@Michael\_Feldmann](https://help.nextcloud.com/u/Michael_Feldmann)\
**Post date:** [July 26, 2020, 7:38pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/3 "2020-07-26T19:38:35Z")

</div>

Thank you, j-ed, for pointing me to the stat command. Very much hidden in a subdirectory, I found the bad guy with a mtime flag deep in the past:

_File: ‘Flyer - Mal dich stark.pdf’_  
_Size: 6846263 Blocks: 13376 IO Block: 4096 regular file_  
_Device: 6850b641h/1750120001d Inode: 6425310 Links: 1_  
_Access: 2020-07-26 13:58:33.613458807 +0200_  
_Modify: 1915-01-23 22:02:56.000000000 +0100_  
_Change: 2020-07-13 13:45:11.190947188 +0200_

The 1915 date probably translates into the future, thus showing a date in the year 4500 in the nextcloud web interface.  
As these are customer data, I don’t feel like touching the content of the file. But I set the mtime attribute  
to some reasonable value, will nextcloud correct its tables when I redo the occ:scan?

Mike

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [July 26, 2020, 7:54pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/4 "2020-07-26T19:54:48Z")

</div>

You can use the touch command to change the modification date of a file:

[https://www.thegeekstuff.com/2012/11/linux-touch-command/](https://www.thegeekstuff.com/2012/11/linux-touch-command/)

---

<div class="post-metadata">

**Author:** ![Michael\_Feldmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michael_feldmann/32/27474_2.png) [@Michael\_Feldmann](https://help.nextcloud.com/u/Michael_Feldmann)\
**Post date:** [July 27, 2020, 8:14am UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/5 "2020-07-27T08:14:53Z")

</div>

j-ed, thank you for hinting to “touch”. I have altered the mtime attribute for the file in question, such that stat now shows:

> File: ‘Flyer - Mal dich stark.pdf’  
> Size: 6846263 Blocks: 13376 IO Block: 4096 regular file  
> Device: 6850b641h/1750120001d Inode: 6425447 Links: 1  
> Access: (0644/-rw-r–r–) Uid: ( 33/www-data) Gid: ( 33/www-data)  
> Access: 2020-07-26 22:39:17.883431547 +0200  
> Modify: 2020-07-26 22:23:36.505969660 +0200  
> Change: 2020-07-26 22:39:17.153419557 +0200

“stat” on the the top level directory of this file, which is “team-bonn”, shows

> ```
> File: 'team-bonn'
> Size: 4096 Blocks: 8 IO Block: 4096 directory
> Device: 6850b641h/1750120001d Inode: 5376414 Links: 12
> Access: (0755/drwxr-xr-x) Uid: ( 33/www-data) Gid: ( 33/www-data)
> Access: 2020-07-27 09:18:33.506950511 +0200
> Modify: 2020-07-06 06:43:01.138606389 +0200
> Change: 2020-07-06 06:43:01.138606389 +0200
> 
> ```

Consequently, everything should be OK.

In the mysql-nextcloud-table “oc\_filecache”, however, I still find an mtime entry for the top level directory “team-bonn”, which points into the future:

> files/team-bonn a9846e72d276ab5645bbb8fe0748c9a1 113 team-bonn 2 1 44414444845 79870665600 1594010581 0

“79870665600” converts to “Sat, 01 Jan 4501 00:00:00 GMT”, which is what shows on the nextcloud web page.  
As the stat command on this directory seems OK, I am not sure what to do now.

---

<div class="post-metadata">

**Author:** ![j-ed](https://help.nextcloud.com/user_avatar/help.nextcloud.com/j-ed/32/7281_2.png) [@j-ed](https://help.nextcloud.com/u/j-ed)\
**Post date:** [July 27, 2020, 5:14pm UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/6 "2020-07-27T17:14:17Z")

</div>

Have you updated the file table by executing `occ files:scan ...`? You can also try to clear the web server caches by restarting the instances if this doesn’t help.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:52am UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/7 "2024-12-12T07:52:03Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:52am UTC](https://help.nextcloud.com/t/how-can-i-fix-incorrect-date-info-for-a-directory/88266/8 "2024-12-12T07:52:04Z")

</div>


