How does java convert utc strings to timestamps?

there is such a string:

Fri, 06 Jul 2018 06:26:03 GMT

is through the front end

(new Date()).toUTCString();

converted

after the backend java receives it, how can it be converted to a standard utc timestamp?

Mar.24,2021

new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH) .parse (yourTime);


Date date = new Date ("Fri, 06 Jul 2018 06:26:03 GMT"); is fine.
date.getTime (); can get a timestamp. I think your time should be 14:26:3 Beijing time on 2018-7-6


SpringMVC receives the string using @ DateTimeFormat (pattern= "EEE, dd MMM yyyy HH:mm:ss z") format

Menu