Sql server 如何为SSIS表达式添加时间?
我当前使用此表达式获取当前时间:Sql server 如何为SSIS表达式添加时间?,sql-server,tsql,ssis,Sql Server,Tsql,Ssis,我当前使用此表达式获取当前时间: Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) <br> + Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2) Right(“0”+(DT_STR,21252)DatePart(“hh”,getdate()),2) +右(“0”+(DT_STR,21252)日期部分(“mi”,getdate()),2) 示例输出:1830
Right("0" + (DT_STR,2,1252) DatePart("hh",getdate()),2) <br>
+ Right("0" + (DT_STR,2,1252) DatePart("mi",getdate()),2)
Right(“0”+(DT_STR,21252)DatePart(“hh”,getdate()),2)
+右(“0”+(DT_STR,21252)日期部分(“mi”,getdate()),2)
示例输出:1830
如何加上或减去小时来计算时区?您正在寻找该函数。因此,要在当前日期的基础上增加2小时,您可以执行以下操作:
DATEADD(hour, 2, getdate())
您正在寻找函数。因此,要在当前日期的基础上增加2小时,您可以执行以下操作:
DATEADD(hour, 2, getdate())
我没有得到你想要的,但是dateadd(hour,5,getdate())可以用来在date中添加小时,可以用来从date中获取时间,而dateadd(hour,5,getdate())可以用来在date中添加小时,可以用来从date中获取时间