![]() |
VOOZH | about |
The ISO 8601 standard provides a convenient way to represent dates and times in a string format that can be easily parsed.
In this article, we will learn how to convert a string in ISO 8601 format to a java.util.Date object.
To convert this ISO 8601 string to a Date, we can use the SimpleDateFormat class. SimpleDateFormat allows us to specify a pattern that matches the format of the string, and then parse the string into a Date.
Note: We will be using the java.text.SimpleDateFormat class to parse the ISO 8601 string into a Date.
Below is the program for converting an ISO 8601 string to a Date:
Thu Feb 08 11:21:56 UTC 2024
In the above program,
Note: Here, by default the timezone is in UTC format, you can also change it according to the need.