简体   繁体   English

如何将该日期时间字符串转换为Java日期变量?

[英]How to convert this datetime string into a Java date variable?

Sun Jan 09 2011 22:00:00 GMT+0000 (GMT Standard Time)

I have the above string coming from JavaScript. 我上面的字符串来自JavaScript。

How do I convert that into a Java DateTime? 如何将其转换为Java DateTime?

With SimpleDateFormat.parse . 使用SimpleDateFormat.parse See the pattern docs located up at the top of that page to help you figure out what pattern you want to use for your parsing format string. 请参阅该页面顶部的模式文档 ,以帮助您确定要用于解析格式字符串的模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM