Oharra
Baimena behar duzu orria atzitzeko. Direktorioetan saioa has dezakezu edo haiek alda ditzakezu.
Baimena behar duzu orria atzitzeko. Direktorioak alda ditzakezu.
Tipo que contiene funciones auxiliares estáticas para convertir un Windows::Foundation::D ateTime (es decir, un std::chrono::time_point) a y desde winrt::file_time, y hacia y desde time_t.
winrt::clock se define como usando las mismas unidades que Windows::Foundation::D ateTime (un entero de 64 bits con signo de intervalos de 100 nanosegundos desde el 1 de enero de 1601). Otros relojes estándar de C++ no suelen definir su resolución y no usan la época 1 de enero de 1601, que es una época Windows Runtime/FILETIME.
Sintaxis
struct clock
Requisitos
SDK mínimo admitido: sdk de Windows versión 10.0.17134.0 (Windows 10, versión 1803)
Espacio de nombres: winrt
Encabezado: %WindowsSdkDir%IncludeWindowsTargetPlatformVersion<>\cppwinrt\winrt\base.h (incluido de forma predeterminada)
Alias de tipo de miembro
| Nombre de alias | Tipo |
|---|---|
| clock::rep | Sinónimo de int64_t. |
| clock::p eriod | Sinónimo de Windows::Foundation::TimeSpan::p eriod. |
| clock::d uration | Sinónimo de Windows::Foundation::TimeSpan. |
| clock::time_point | Sinónimo de Windows::Foundation::D ateTime. |
Funciones miembro
| Función | Descripción |
|---|---|
| clock::now (Función) | Recupera la hora actual como Windows::Foundation::D ateTime. |
| clock::from_file_time (función) | Convierte un valor winrt::file_time en un valor Windows::Foundation::D ateTime. |
| clock::from_time_t (función) | Convierte un valor de time_t en una Windows::Foundation::D ateTime. |
| clock::to_file_time (función) | Convierte un valor Windows::Foundation::D ateTime en winrt::file_time. |
| clock::to_time_t (función) | Convierte un valor Windows::Foundation::D ateTime en un time_t. |
clock::now (Función)
Recupera la hora actual como Windows::Foundation::D ateTime.
Sintaxis
static Windows::Foundation::DateTime now() noexcept;
Valor devuelto
La hora actual como Windows::Foundation::D ateTime.
clock::from_file_time (función)
Convierte un valor winrt::file_time en un valor Windows::Foundation::D ateTime.
Sintaxis
static Windows::Foundation::DateTime from_file_time(winrt::file_time const& time) noexcept;
Parámetros
timeValor winrt::file_time que se va a convertir en Windows::Foundation::D ateTime.
Valor devuelto
El valor winrt::file_time convertido en un valor Windows::Foundation::D ateTime.
clock::from_time_t (función)
Convierte un valor de time_t en una Windows::Foundation::D ateTime.
Sintaxis
static Windows::Foundation::DateTime from_time_t(time_t time) noexcept;
Parámetros
timeValor de time_t que se va a convertir en Windows::Foundation::D ateTime.
Valor devuelto
Valor de time_t convertido en Windows::Foundation::D ateTime.
clock::to_file_time (función)
Convierte un valor Windows::Foundation::D ateTime en winrt::file_time.
Sintaxis
static file_time to_file_time(Windows::Foundation::DateTime const& time) noexcept;
Parámetros
timeValor Windows::Foundation::D ateTime que se va a convertir en winrt::file_time.
Valor devuelto
El valor Windows::Foundation::D ateTime convertido en winrt::file_time.
clock::to_time_t (función)
Convierte un valor Windows::Foundation::D ateTime en un time_t.
Sintaxis
static time_t to_time_t(Windows::Foundation::DateTime const& time) noexcept;
Parámetros
timeValor Windows::Foundation::D ateTime que se va a convertir en un time_t*.
Valor devuelto
El valor Windows::Foundation::D ateTime convertido en un time_t.