Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从 SQLITE 数据库获取日期,例如:2012-05-07 20:59:45
尝试执行此代码,但失败
DateFormat formatter = new SimpleDateFormat("dd-MMM-yy"); Date date = formatter.parse("2012-05-07 20:59:45");
那我该怎么做呢?也试过SimpleDateFormat("dd-MMM-yy HH:mm:ss")
SimpleDateFormat("dd-MMM-yy HH:mm:ss")
你试过SimpleDateFormat("yyyy-MM-dd HH:mm:ss")吗?
SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
你尝试如下,
DateFormat formatter = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); Date date = formatter.parse("2012-05-07 20:59:45");