diff --git a/samples/Sample.BulkConsole/Program.cs b/samples/Sample.BulkConsole/Program.cs index b1c000e2..6047b097 100644 --- a/samples/Sample.BulkConsole/Program.cs +++ b/samples/Sample.BulkConsole/Program.cs @@ -25,6 +25,7 @@ namespace Sample.BulkConsole }); static void Main(string[] args) { + var s = Guid.NewGuid().ToString("n"); var services = new ServiceCollection(); services.AddLogging(); diff --git a/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyDateTimeVirtualTableRoute.cs b/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyDateTimeVirtualTableRoute.cs index 0a8cf525..cef83a47 100644 --- a/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyDateTimeVirtualTableRoute.cs +++ b/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyDateTimeVirtualTableRoute.cs @@ -22,7 +22,8 @@ namespace ShardingCore.VirtualRoutes.Years var tails=new List(); //提前创建表 - var nowTimeStamp = DateTime.Now.Date; + var now = DateTime.Now; + var nowTimeStamp = new DateTime(now.Year,1,1); if (beginTime > nowTimeStamp) throw new ArgumentException("begin time error"); var currentTimeStamp = beginTime; diff --git a/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyLongVirtualTableRoute.cs b/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyLongVirtualTableRoute.cs index a37b4a4f..22113399 100644 --- a/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyLongVirtualTableRoute.cs +++ b/src/ShardingCore/VirtualRoutes/Years/AbstractSimpleShardingYearKeyLongVirtualTableRoute.cs @@ -31,7 +31,8 @@ namespace ShardingCore.VirtualRoutes.Years var tails=new List(); //提前创建表 - var nowTimeStamp = DateTime.Now.Date; + var now = DateTime.Now; + var nowTimeStamp = new DateTime(now.Year,1,1); if (beginTime > nowTimeStamp) throw new ArgumentException("begin time error"); var currentTimeStamp = beginTime;