improved function for date and time strings display