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