Use TimeParser to improve parsing performance and add its tests