This content has been marked as final. Show 3 replies
Do you have a Date object? you can use its getTime() method to get the millisecond value from January 1, 1970, 00:00:00 GMT.
If you have your date as a string, use SimpleDateFormat's parse method to convert it to a Date first.
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.