Solved: I need to convert a date to a string and then back to a date as I am experiencing the problem outlined in this article. How do you go. DateString gives a string representing the complete current local date and time. DateString["elem"] gives the specified element or format for date and time. Converting a string to a date in Java (or any programming language) is a fundamental skill and is useful to know when working on projects. The following example uses the "o" format specifier to display a series of DateTime values and a DateTimeOffset value on a system in the U, date string. Sometimes, it's simply easier to work with a string to represent a date, and then convert it into a Date object for further use. If this still doesn't satisfy your need for a custom formatter, you can use DateTimeFormatterBuilder to build very specific date string complex formatters. If no pattern matches the input string, a ParseException is thrown. Converting a String to a ZonedDateTime object is as simple as: Hour in a 12h style 1, date string, 5, 12 m: Kind ' Round-trip a UTC time.