Fixed LocalTime in Upload module

This commit is contained in:
root
2021-09-27 09:02:38 +02:00
parent 5fbe01f6fe
commit 783e730624
3 changed files with 6 additions and 4 deletions

View File

@@ -39,7 +39,8 @@ class Upload extends Controller
// File upload location
$location = config('app.image.dir');
date_default_timezone_set("Europe/Bratislava");
$backupdir = Carbon::now()->format('Y/m/d');
$backupdir = sprintf($location.'/backup/%s',$backupdir);
$thumbdir = sprintf('%s/%s', config('app.image.thumb_dir'), Carbon::now()->format('Y/m/d'));

View File

@@ -80,7 +80,7 @@ return [
|
*/
'locale' => 'en',
'locale' => 'sk_SK',
/*
|--------------------------------------------------------------------------

View File

@@ -13,12 +13,13 @@
Route::get('/', function () {
$dir = public_path().'/'.config('app.image.dir').'/backup/'.date('Y/m/d');
date_default_timezone_set('Europe/Bratislava');
$files = \File::allFiles($dir);
$items = [];
foreach ($files as $file) {
$pstat = stat($file);
$time = date('Y M D H:i:s',$pstat['mtime']);
$time = date('d.m.Y H:i:s',$pstat['mtime']);
$thumb_file = str_replace('backup','thumb',$file);
$item = ['src' => str_replace($_SERVER['DOCUMENT_ROOT'], '', $file),