current_time('mysql') get wrong time

I'm using wordpress and I for media upload, I checked uploadsuseyearmonth_folders. Even though it is late August now, my uploads still go to folder "2016/07/"

I revised wp-includes/functions.php to include the days and get the following

~~![](<URL url=)http://tianyi.li/wp-content/uploads/201 … 0-5@2x.png">http://tianyi.li/wp-content/uploads/2016/08/QQ20160820-5@2x.png" />

and what I get is like:

~~![](<URL url=)http://tianyi.li/wp-content/uploads/201 … 0-6@2x.png">http://tianyi.li/wp-content/uploads/2016/08/QQ20160820-6@2x.png" />

so today is 20th August, but the upload reads as 25th July.

I think this time goes from mysql, but when I check the mysql time, I get:

~~![](<URL url=)http://tianyi.li/wp-content/uploads/201 … 0-7@2x.png">http://tianyi.li/wp-content/uploads/2016/08/QQ20160820-7@2x.png" />

Something cause this maybe few days ago, I use the option 2 in the following article to backup and recover my database,

https://www.linode.com/docs/databases/m … -databases">https://www.linode.com/docs/databases/mysql/back-up-your-mysql-databases

which overrides all the files in mysql folder.

So, for now, I ask for help and is there anyone knows how to fix it?~~

1 Reply

Even though Option 2 in the guide is not recommended if your database was running (ensure it isn't if you perform this again), it shouldn't make an error like this happen. My guess is that it has to do with your code, as it only pulls new current date from the DB if $time doesn't exist, so if it's already being declared to an earlier date, then that is how you're getting an older date as your directory.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct