人大金仓时区问题 返回

SqlSugar 沟通中
5 621

现在有个问题人大金仓插入的时间总差8小时,

public virtual async Task<bool> UpdateAsync(T entity, CancellationToken cancellationToken = default)

{

    try

    {

        var rows = await _db.Updateable(entity)

            .ExecuteCommandAsync(cancellationToken);

        _logger.LogDebug("更新 {EntityType},ID: {Id},影响行数: {Rows}",

            typeof(T).Name, GetEntityId(entity), rows);

        return rows > 0;

    }

    catch (Exception ex)

    {

        _logger.LogError(ex, "更新 {EntityType} 失败", typeof(T).Name);

        throw;

    }

}

连接串加了TimeZone=Asia/Shanghai 金仓数据库配置文件 改了 timezone = 'Asia/Shanghai'  log_timezone = 'Asia/Shanghai' 数据库字段分别用了timestamp with time zone和 timestamp 执行之前 看了entity里时间字段的kind类型 是local 进数据库就差8小时,得怎么解决


热忱回答5