Log Parser从UTC减去5

时间:2015-06-30 04:43:13

标签: .net iis logging iis-7 logparser

如何将时间转换为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

2 个答案:

答案 0 :(得分:0)

我得到了答案。

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

答案 1 :(得分:0)

上面的答案对我不起作用。 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')