Thank you for replying. Actually i dont have Date object and also i dont have it in standard format. User will tell me a date like January 1, 2010 10:45:00. This date can be future date. I have to convert it in milliseconds.
Use java.text.SimpleDateFormat then. You can look up the documentation of this method to learn more about the patterns supported.