Getting milliseconds on a time stamp

Then just use the time to the second and whatever value millis() mod 1000 gives you. Or else cast the result of millis() to an int - in which case it will still never yield the same value in the same second.