@@ -200,12 +200,26 @@ namespace RC
200200 {
201201 m_console_device = &Output::set_default_devices<Output::ConsoleDevice>();
202202 m_console_device->set_formatter ([](File::StringViewType string) -> File::StringType {
203- static const auto timezone = std::chrono::current_zone ();
204- return fmt::format (STR (" [{}] {}" ),
205- fmt::format (STR (" {:%X}" ),
206- std::chrono::time_point_cast<std::chrono::system_clock::duration>(
207- timezone->to_local (std::chrono::system_clock::now ()))),
208- string);
203+ bool use_local_time = true ;
204+ #ifdef _WIN32
205+ if (auto module = GetModuleHandleW (L" ntdll.dll" ); module && GetProcAddress (module , " wine_get_version" ))
206+ {
207+ use_local_time = false ;
208+ }
209+ #endif
210+ if (use_local_time)
211+ {
212+ static const auto timezone = std::chrono::current_zone ();
213+ return fmt::format (STR (" [{}] {}" ),
214+ fmt::format (STR (" {:%X}" ),
215+ std::chrono::time_point_cast<std::chrono::system_clock::duration>(
216+ timezone->to_local (std::chrono::system_clock::now ()))),
217+ string);
218+ }
219+ else
220+ {
221+ return fmt::format (STR (" [{}] {}" ), fmt::format (STR (" {:%X}" ), std::chrono::system_clock::now ()), string);
222+ }
209223 });
210224 if (settings_manager.Debug .DebugConsoleVisible )
211225 {
@@ -243,7 +257,21 @@ namespace RC
243257 ? STR (" " )
244258 : (UE4SS_LIB_IS_BETA == 0 ? STR (" Beta #?" ) : fmt::format (STR (" Beta #{}" ), UE4SS_LIB_VERSION_BETA))),
245259 ensure_str (UE4SS_LIB_BUILD_GITSHA));
246- Output::send (STR (" Timezone: {}\n " ), ensure_str (std::chrono::current_zone ()->name ()));
260+ bool use_local_time = true ;
261+ #ifdef _WIN32
262+ if (auto module = GetModuleHandleW (L" ntdll.dll" ); module && GetProcAddress (module , " wine_get_version" ))
263+ {
264+ use_local_time = false ;
265+ }
266+ #endif
267+ if (use_local_time)
268+ {
269+ Output::send (STR (" Timezone: {}\n " ), ensure_str (std::chrono::current_zone ()->name ()));
270+ }
271+ else
272+ {
273+ Output::send (STR (" Timezone: UTC (local disabled due to wine)\n " ));
274+ }
247275
248276#ifdef __clang__
249277#define UE4SS_COMPILER STR (" Clang" )
@@ -482,12 +510,26 @@ namespace RC
482510 m_debug_console_device = &Output::set_default_devices<Output::DebugConsoleDevice>();
483511 Output::set_default_log_level<LogLevel::Normal>();
484512 m_debug_console_device->set_formatter ([](File::StringViewType string) -> File::StringType {
485- static const auto timezone = std::chrono::current_zone ();
486- return fmt::format (STR (" [{}] {}" ),
487- fmt::format (STR (" {:%X}" ),
488- std::chrono::time_point_cast<std::chrono::system_clock::duration>(
489- timezone->to_local (std::chrono::system_clock::now ()))),
490- string);
513+ bool use_local_time = true ;
514+ #ifdef _WIN32
515+ if (auto module = GetModuleHandleW (L" ntdll.dll" ); module && GetProcAddress (module , " wine_get_version" ))
516+ {
517+ use_local_time = false ;
518+ }
519+ #endif
520+ if (use_local_time)
521+ {
522+ static const auto timezone = std::chrono::current_zone ();
523+ return fmt::format (STR (" [{}] {}" ),
524+ fmt::format (STR (" {:%X}" ),
525+ std::chrono::time_point_cast<std::chrono::system_clock::duration>(
526+ timezone->to_local (std::chrono::system_clock::now ()))),
527+ string);
528+ }
529+ else
530+ {
531+ return fmt::format (STR (" [{}] {}" ), fmt::format (STR (" {:%X}" ), std::chrono::system_clock::now ()), string);
532+ }
491533 });
492534
493535 if (AllocConsole ())
0 commit comments