convert using date method rather than string formatting