MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Convert

Method Convert

FastCopy/DateTimeToStringConverter.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace winrt::FastCopy::implementation
9{
10 winrt::Windows::Foundation::IInspectable DateTimeToStringConverter::Convert(
11 winrt::Windows::Foundation::IInspectable const& value,
12 winrt::Windows::UI::Xaml::Interop::TypeName const& targetType,
13 winrt::Windows::Foundation::IInspectable const& parameter,
14 winrt::hstring const& language)
15 {
16 auto const p = winrt::unbox_value<winrt::Windows::Foundation::DateTime>(value);
17 auto p2 = std::chrono::clock_cast<std::chrono::system_clock>(p);
18 auto result = (std::wstringstream{} << p2).str();
19 result = result.substr(0, result.rfind(L"."));
20 return winrt::box_value(result);
21 }
22
23 winrt::Windows::Foundation::IInspectable DateTimeToStringConverter::ConvertBack(
24 winrt::Windows::Foundation::IInspectable const& ,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected