• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding Timestamp pattern from a String  RSS feed

 
Akshay Bondre
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to convert a String into Timestamp, the pattern for which is unknown. Is there any API given by java which allows us to feed in the string and returns the possible patterns that could work with it? I understand that one could have some pre-defined patterns against which the String can be parsed and checked. But, since this is a timestamp, the number combinations of different dates and times will be quite a lot. So, was looking for an efficient way of figuring out the pattern of the String-Timestamp.
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted on stackoverflow. Please BeForthrightWhenCrossPostingToOtherSites
 
Akshay Bondre
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:Cross posted on stackoverflow. Please BeForthrightWhenCrossPostingToOtherSites


I wasn't aware of this. Apologies to people who do get offended by cross posting.
I do believe that different set of people visit different forums and hence my intent while cross posting was only to get a quick reply.

A topic regarding the same doubt has been created at the following link too :

http://stackoverflow.com/questions/9156712/finding-timestamp-pattern-from-a-string
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unless there are some rules on the format, this is impossible.
as the date 2012-01-03 could mean 3rd january or the 1st March 2012.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wendy Gibbons wrote:unless there are some rules on the format, this is impossible.
as the date 2012-01-03 could mean 3rd january or the 1st March 2012.

I have to admit, I've never seen yyyy-dd-mm but, thanks to the @#!£* Americans, we do have mm-dd-yyyy.

But I take your point .

Winston
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Wendy Gibbons wrote:unless there are some rules on the format, this is impossible.
as the date 2012-01-03 could mean 3rd january or the 1st March 2012.

I have to admit, I've never seen yyyy-dd-mm but, thanks to the @#!£* Americans, we do have mm-dd-yyyy.

But I take your point .

Winston


fair point 01-03-2012
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!