I want to parse an xml log file, using Java. The weird thing though is that it contains timestamps like this:
timestamp="1313932930.025"
It does not really seem as a unix timestamp since at first look it's a double. Furthermore Java does not offer (to my knowledge) any contructor in the Timestamp class,开发者_StackOverflow that takes a Double argument.
Does anybody know what is this form and how could it be possibly parsed into a datetime human readable string?
It's a unix timestamp with fractional seconds. Multiply it by 1000 and then it's in milliseconds which is what Java is expecting.
Just remove the dot from that string and parse it as long.
精彩评论