Your program is doing this:
01. Create a DateFormat object with the pattern "EEE MMM dd HH:mm:ss.SSS zzz yyyy"
02. Create a Calendar
03. Set the Calendar to the current date and time (not necessary because it is already set to the current date and time)
05. Format the current date and time of the Calendar to a String with the format "EEE MMM dd HH:mm:ss.SSS zzz yyyy"
08. Parse the string back to a Date object (why? you could just as well have done Date date_set = Calendar.getTime())
09. Print the Date object by calling toString() on it implicitly
You seem to expect that the Date object you create in line 8 remembers the format. It doesn't. Date objects do not know anything about formats. When you print the Date object in line 9, some fixed, default format will be used. Not the format "EEE MMM dd HH:mm:ss.SSS zzz yyyy" because the Date object doesn't know that it was created using that format string.
The fixed, default format doesn't include the milliseconds. If you need to display the milliseconds, then you'll need to format the Date object yourself using an appropriate DateFormat object, instead of calling toString() (explicitly or implicitly) on the Date object.
buntha Choudhary wrote:I want it in Date.
If you expect the Date object to be able to format itself displaying milliseconds, then that's not possible, as we're trying to explain to you.