I have got my answer, hope this will be useful for others as well.
use formula as type for field and write this formula.
If you want to get till seconds, then type DateTime.now.strftime('%s'), this will give 10 digit number.
If you want to get till milliseconds, then type DateTime.now.strftime('%Q'), this will give 13 digit number.