Better formatting, by using a function instead of substring, that gives the local time