English 中文(简体)
一些字符串的日期格式模式
原标题:DateFormat Pattern for some strings

我有些不同的日期格式可以解析, 但我无法用 < code> SoperDate Format 来识别它们。 有人能帮我找到这个日期的模式吗 :

  • 6 July 1892
  • 9 May 1915
  • February 335
  • 1768-02-12

  • 23 september 63 bc
  • 19 august ad 14

谢谢 谢谢

最佳回答

您只是提供了模式的可能性, 您希望您的日期能够通过它们找到第一个匹配点, 并运行到它们中 。

解答。

问题回答

Here you can find a great generator for creating every date format you can imagine http://www.fileformat.info/tip/java/simpledateformat.htm

例如,您的第一个例子都是用 dd MMM yyyy 生成的;)

尝尝这个

2012年5月27日至2012年5月27日:

System.out.println(新的简单日期格式 (“ d- MMM- YYYYY”)).format( 新日期 () );

27-05-2012年:

System.out.println(new SimpleDateFormat("d-MM-YYYY").format(new Date()));

27-05-12:

System.out.println(new SimpleDateFormat("dd-MM-YY").format(new Date()));




相关问题
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 ...

热门标签