I want to convert "Tue Feb 27 2024 16:35:30 GMT+0800" String to ZonedDateTime type
I use new ZonedDateTime.ofInstant(new Date("Tue Feb 27 2024 16:35:30 GMT+0800").toInstant(), ZoneId.of("Asia/Shanghai"))
but new Date() is Deprecated
I want to convert "Tue Feb 27 2024 16:35:30 GMT+0800" String to ZonedDateTime type
I use new ZonedDateTime.ofInstant(new Date("Tue Feb 27 2024 16:35:30 GMT+0800").toInstant(), ZoneId.of("Asia/Shanghai"))
but new Date() is Deprecated
Copyright © 2021 Jogjafile Inc.
How about using
DateTimeFormatterand trying this?