Timestamp function modified