added function for formatting datetimestamp