mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 18:22:23 +08:00
Update TDengine
This commit is contained in:
@@ -80,9 +80,13 @@ namespace SqlSugar.TDengine
|
||||
return GetDbColumn(it, null);
|
||||
}
|
||||
object value = null;
|
||||
if (it.Value is DateTime)
|
||||
if (it?.Value is DateTime)
|
||||
{
|
||||
value = ((DateTime)it.Value).ToString("O");
|
||||
value = it.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
}
|
||||
else if (it?.Value is bool)
|
||||
{
|
||||
value = value?.ToString()?.ToLower();
|
||||
}
|
||||
else if (it.Value is DateTimeOffset)
|
||||
{
|
||||
|
@@ -16,6 +16,19 @@ namespace SqlSugar.TDengine
|
||||
{
|
||||
public class UtilMethods
|
||||
{
|
||||
public static long ToUnixTimestamp(DateTime dateTime)
|
||||
{
|
||||
// If the DateTime is Utc, use ToUnixTimeMilliseconds directly
|
||||
if (dateTime.Kind == DateTimeKind.Utc)
|
||||
{
|
||||
return new DateTimeOffset(dateTime).ToUnixTimeMilliseconds();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Convert local DateTime to Utc before converting to Unix timestamp
|
||||
return new DateTimeOffset(dateTime.ToUniversalTime()).ToUnixTimeMilliseconds();
|
||||
}
|
||||
}
|
||||
internal static DateTime GetMinDate(ConnectionConfig currentConnectionConfig)
|
||||
{
|
||||
if (currentConnectionConfig.MoreSettings == null)
|
||||
|
Reference in New Issue
Block a user