未验证 提交 80a87159 编写于 作者: H Huo Linhe 提交者: GitHub

[TD-2976]<fix>: check 1970 timestamp support in C# taosdemo (#5813)

上级 bcebfbe8
...@@ -385,7 +385,7 @@ namespace TDengineDriver ...@@ -385,7 +385,7 @@ namespace TDengineDriver
public void CreateDb() public void CreateDb()
{ {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.Append("CREATE DATABASE IF NOT EXISTS ").Append(this.dbName).Append(" replica ").Append(this.replica); sql.Append("CREATE DATABASE IF NOT EXISTS ").Append(this.dbName).Append(" replica ").Append(this.replica).Append(" keep 36500");
IntPtr res = TDengine.Query(this.conn, sql.ToString()); IntPtr res = TDengine.Query(this.conn, sql.ToString());
if (res != IntPtr.Zero) if (res != IntPtr.Zero)
{ {
...@@ -728,7 +728,7 @@ namespace TDengineDriver ...@@ -728,7 +728,7 @@ namespace TDengineDriver
int m = now.Minute; int m = now.Minute;
int s = now.Second; int s = now.Second;
long baseTimestamp = 1609430400000; // 2021/01/01 0:0:0 long baseTimestamp = -16094340000; // 1969-06-29 01:21:00
VerbosePrintFormat("beginTime is {0} + {1}h:{2}m:{3}s\n", baseTimestamp, h, m, s); VerbosePrintFormat("beginTime is {0} + {1}h:{2}m:{3}s\n", baseTimestamp, h, m, s);
long beginTimestamp = baseTimestamp + ((h * 60 + m) * 60 + s) * 1000; long beginTimestamp = baseTimestamp + ((h * 60 + m) * 60 + s) * 1000;
Random random = new Random(); Random random = new Random();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册