English 中文(简体)
我怎么能将体格转换为“及时”友好型格式?
原标题:How can I convert a string to a "datetime"-friendly format?

我基本上试图将类似于“2011-11-9 18:24:12.3<>/code”的体格转换为一种格式,我可以插入一个数据库表,声称该特定栏为“日期”类型。 我的数字是,我可以按照<代码>准备声明.settimestamp(...)的方针做一些事情,但我似乎无法得到一个准确创建的时间安插。 谁能提出最容易的办法,将上文提到的扼杀变成一个与MySQL的“时日”类型相容的安静室或其他一些类型? 希望得到任何帮助。

迄今为止,我曾尝试做过这样的事情:

String strDateTime = "2011-11-9 18:24:12.3";
Timestamp timeStamp = new Timestamp((new Date(strDateTime)).getTime());
preparedStatement.setTimestamp(1, timeStamp);
最佳回答

因此,问题很可能不是在我的时代,而是在日期。

,目前对进行了解释,并建议使用

问题回答

你们是否试图分裂,把它变成你可以使用的一种形式? 这假定,这在任何时候都采用相同的格式。 创造新的护法,以有益的方式将旧的护卫和重新安排分开。 如果这是最终用户提供的扼杀物,你可能必须首先加以验证,并检查以确保它能够使用。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签