EntityHelperResetEntityUTCDateTimeKindToLocal Property

指示当 EntityDateTimeKindUtc 时,是否将实体时间的 DateTimeKind 强制设置为 Local

Definition

Namespace: QuickAdmin.EntityBase
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 2.0.13
C#
public static bool ResetEntityUTCDateTimeKindToLocal { get; set; }

Property Value

bool
默认为 false

Remarks

EntityDateTimeKindUtc,假设当前时间为北京时间 "2010-01-30 18:00:00"
  • 当此属性值为 false 时,NowForEntity 将为 "2010-01-30 10:00:00" 且其 KindUtc
  • 当此属性值为 true 时,NowForEntity 将为 "2010-01-30 10:00:00" 且其 KindLocal
将此属性置为 true 的一个场景为:数据库表中各日期时间字段要存储 Utc 时间,但不要存储时区信息。

See Also