Fix timestamp function on mac