public static CfxTime FromUniversalTime(DateTime time) { if (time.Kind != DateTimeKind.Utc) { throw new ArgumentException("time must be of kind DateTimeKind.Utc", "time"); } var r = new CfxTime(); r.Year = time.Year; r.Month = time.Month; r.DayOfMonth = time.Day; r.DayOfWeek = (int)time.DayOfWeek; r.Hour = time.Hour; r.Minute = time.Minute; r.Second = time.Second; r.Millisecond = time.Millisecond; return(r); }
public DateTime ToUniversalTime(CfxTime time) { return(new DateTime(time.Year, time.Month, time.DayOfMonth, time.Hour, time.Minute, time.Second, time.Millisecond, DateTimeKind.Utc)); }
/// <summary> /// Create a new CfxV8Value object of type Date. This function should only be /// called from within the scope of a CfxRenderProcessHandler, /// CfxV8Handler or CfxV8Accessor callback, or in combination with calling /// enter() and exit() on a stored CfxV8Context reference. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>. /// </remarks> public static CfxV8Value CreateDate(CfxTime date) { return(CfxV8Value.Wrap(CfxApi.cfx_v8value_create_date(CfxTime.Unwrap(date)))); }