OffsetDateTime toString()
outputs this date-time as a String, such as 2014-12-03T10:15:30+01:00.
toString
has the following syntax.
public String toString()
The following example shows how to use toString
.
import java.time.OffsetDateTime; public class Main { public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.MAX; System.out.println(o.toString()); } }
The code above generates the following result.