r/javahelp • u/Dependent_Finger_214 • Jan 29 '26
Convert string into java.util.date
I have two string, date (formatted yyyy-MM-dd) and time (HH:mm), how can I convert them into a java.util.date? Date.parse is deprecated
5
Upvotes
View all comments
Show parent comment
1
u/Dependent_Finger_214 Jan 29 '26
Thanks. Seems that instant required a timezone to parse, so I solved it by just tacking "UTC+06:00" to the string and adding z to the datetimeformatter