Use more portable way to get timestamp so that it works on other platform also.