I want to convert a string representation of date in any format to java.sql.Timestamp,(format is also provided)
we have tried using Timestamp.valueOf() and Date.valueOf() but both these method requires String in a particular format,What i need is a generic method which will convert a given String date in any format to java.sql.Timestamp
Thanks in Advance
java.sql.Timestampitself has no format at all and is supposed to be used on the back-end side (JDBC).java.sql.Timestamprepresents the number of milliseconds, sinceJanuary 1, 1970, 00:00:00 GMT. Formatting a date (usingSimpleDateFormat, for example) in a specific format is only involved, when a date is to be displayed somewhere whichjava.sql.Timestampis not meant for.