Convert String date to ISO 8601

  Kiến thức lập trình

I need to convert a String date which is in YYYYMMDDHHMMSS into ISO 8610.

For example I have this Date 20240115050123 with a getTimezoneOffset of -300.

I need to have it as YYYY-MM-DD'T'HH:MM:SS'Z'

I tried SimpleDateFormat but it doesn’t worked.

New contributor

Ten Chu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.