Files
lserp_cs_5.0/插件库/Cef3.24/Interop/Structs/cef_time_t.cs
T
2026-07-10 15:25:05 +08:00

64 lines
1.6 KiB
C#

//
// This file manually written from cef/include/internal/cef_time.h.
//
namespace Cef3.Interop
{
using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = libcef.ALIGN)]
internal unsafe struct cef_time_t
{
public int year;
public int month;
public int day_of_week;
public int day_of_month;
public int hour;
public int minute;
public int second;
public int millisecond;
public cef_time_t(DateTime value)
{
value = value.ToUniversalTime();
year = value.Year;
month = value.Month;
day_of_week = (int)value.DayOfWeek;
day_of_month = value.Day;
hour = value.Hour;
minute = value.Minute;
second = value.Second;
millisecond = value.Millisecond;
}
public DateTime ToDateTime()
{
return new DateTime(
year,
month,
day_of_month,
hour,
minute,
second,
millisecond,
DateTimeKind.Utc
);
}
public static DateTime ToDateTime(cef_time_t* ptr)
{
return new DateTime(
ptr->year,
ptr->month,
ptr->day_of_month,
ptr->hour,
ptr->minute,
ptr->second,
ptr->millisecond,
DateTimeKind.Utc
);
}
}
}