日志解析器从 UTC 中减去 5
Log Parser subtracting 5 from UTC
如何将时间转换为 UTC-5。目前我的时间是 UTC,但我想从那个时间减去 5 小时。
LogParser.exe "SELECT QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(date, time)), 3600) AS Hour, COUNT(*) AS Hits FROM D:\projects\jetstar\deployed\u_ex150628.log WHERE date>'2015-06-27' and date<'2015-06-29' and cs-uri-query LIKE '%%orig%%' Group By Hour" -o:datagrid
我得到了答案。
IT 正在使用 Sub
函数。
LogParser.exe "SELECT SUB( QUANTIZE(TO_TIMESTAMP(date, time), 3600),TIMESTAMP('05:00:00', 'hh:mm:ss')) AS HOUR, COUNT(*) AS Hits FROM D:\projects\jetstar\deployed\u_ex150628.log WHERE date>'2015-06-27' and date<'2015-06-29' and cs-uri-query LIKE '%%orig%%' Group By Hour" -o:datagrid
上面的答案对我不起作用。 QUANTIZE 摆脱了分钟。
这是我用的
SUB(TO_TIMESTAMP(date, time), TIMESTAMP('05:00:00', 'hh:mm:ss'))
如果你想要它作为一个字符串
To_String(SUB(TO_TIMESTAMP(date, time), TIMESTAMP('05:00:00', 'hh:mm:ss')), 'dd/MM/yyyy hh:mm:ss')
如何将时间转换为 UTC-5。目前我的时间是 UTC,但我想从那个时间减去 5 小时。
LogParser.exe "SELECT QUANTIZE(TO_LOCALTIME(TO_TIMESTAMP(date, time)), 3600) AS Hour, COUNT(*) AS Hits FROM D:\projects\jetstar\deployed\u_ex150628.log WHERE date>'2015-06-27' and date<'2015-06-29' and cs-uri-query LIKE '%%orig%%' Group By Hour" -o:datagrid
我得到了答案。
IT 正在使用 Sub
函数。
LogParser.exe "SELECT SUB( QUANTIZE(TO_TIMESTAMP(date, time), 3600),TIMESTAMP('05:00:00', 'hh:mm:ss')) AS HOUR, COUNT(*) AS Hits FROM D:\projects\jetstar\deployed\u_ex150628.log WHERE date>'2015-06-27' and date<'2015-06-29' and cs-uri-query LIKE '%%orig%%' Group By Hour" -o:datagrid
上面的答案对我不起作用。 QUANTIZE 摆脱了分钟。 这是我用的
SUB(TO_TIMESTAMP(date, time), TIMESTAMP('05:00:00', 'hh:mm:ss'))
如果你想要它作为一个字符串
To_String(SUB(TO_TIMESTAMP(date, time), TIMESTAMP('05:00:00', 'hh:mm:ss')), 'dd/MM/yyyy hh:mm:ss')