没有使用任何perl模块(POSIX MKTIME)可以将log4jtime标记转换为毫秒或任何shell命令
2014-03-12 18:11:47,075 INFO BAS_Connector-thread-2 我想转换2014-03-12 18:11:47,075 =>毫秒
答案 0 :(得分:0)
date --date="2014-03-12 18:11:47,075" +%s --> will convert the given date string to epoch number
date --date="2014-03-12 18:11:47,075" +%s%N --> in Nanoseconds
1394662307075000000
date --date="2014-03-12 18:11:47,075" +%s%3N --> in milliseconds
1394662307075
将此转换为毫秒,请检查此SO帖子:Linux command to get time in milliseconds