• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Finding Timestamp pattern from a String

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cross posted on stackoverflow. Please BeForthrightWhenCrossPostingToOtherSites
 
Akshay Bondre
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic