将数组对象转换为时间
如果我有一个包含字符串 07:46:30 pm 、 10:45:28 pm 、 07:23:39 pm 的 Array ,...... .
我想将其转换为时间。我该怎么做?
If i have an Array which contains the Strings 07:46:30 pm , 10:45:28 pm , 07:23:39 pm , .......
and I want to convert it into Time. How can i do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
以下是将给定格式的字符串数组转换为日期数组的方法:
Here's how to convert an array of Strings in the given format to an array of dates:
使用 SimpleDateFormat 类。这是一个例子:
Use the SimpleDateFormat class. Here is an example:
使用 SimpleDateFormat 类来解析日期。
Use the SimpleDateFormat class to parse the date.
您需要编写自己的解析器。请参阅此示例:
http://www.kodejava.org/examples/101.html
You need to write your own parser. See this example:
http://www.kodejava.org/examples/101.html
如果您想要时间数组或列表...
或
数组字符串到数组或列表时间:
If you want a array or list of time...
or
Array string to array or list time: