<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;

// 临时测试时区路由
Route::get('/test-timezone', function () {
    // 记录测试日志
    \Log::info('时区测试 - 检查当前时间', [
        'timezone' => date_default_timezone_get(),
        'current_time' => date('Y-m-d H:i:s T (e)'),
        'chinese_format' => date('Y年m月d日 H:i:s'),
        'offset' => date('P'),
        'timestamp' => time(),
    ]);

    return response()->json([
        'status' => 'success',
        'message' => '时区设置测试',
        'data' => [
            'timezone' => date_default_timezone_get(),
            'current_time' => date('Y-m-d H:i:s T (e)'),
            'chinese_format' => date('Y年m月d日 H:i:s'),
            'offset' => date('P'),
            'timestamp' => time(),
            'laravel_config' => config('app.timezone'),
        ],
        'time' => now(),
    ]);
})->name('test.timezone');
