1订单统计时区问题修复 2退货订单逻辑50% 3其他一些功能小改动
This commit is contained in:
1 parent
342a66f940
commit
24cf1dba7b
11 files changed
+121
-89
No files matched your search
@@ -359,7 +359,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
{
|
||||
long milliseconds = (long)reader.Value;
|
||||
// Unix 纪元:1970-01-01 UTC
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
@@ -373,7 +374,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
{
|
||||
if (long.TryParse((string)reader.Value, out long milliseconds))
|
||||
{
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
if (milliseconds.ToString().Length == 13)
|
||||
{
|
||||
return epoch.AddMilliseconds(milliseconds);
|
||||
@@ -388,7 +390,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Models
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
// 序列化时转回时间戳
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
//DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime epoch = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
long milliseconds = (long)((DateTime)value - epoch).TotalMilliseconds;
|
||||
writer.WriteValue(milliseconds);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user