in reply to Re^3: localtime function
in thread localtime function

Without knowing what your input file exactly looks like, I can only guess that the problem is that you've got "invalid" time values in there that you might want to filter out or fix when converting.

localtime() is taking starttime as a string & converting it to a default date

Yes, that is what localtime does. What is the problem?

You still haven't shown us: a representative sample of your input (i.e. a properly formatted copy-paste of the input file including those lines that cause the problem), your exact expected output; also your posts still aren't formatted properly.

Please take the time to read, understand and follow How do I post a question effectively? - help us to help you and you will find your questions can be answered much better and faster.