GetLocalTimestamp := inttostr(Trunc((Now - EncodeDate(1970, 1 ,1)) * 24 * 60 * 60));
But it is only seconds precision.
Yes, because that is what the code as written is supposed to do, convert a floating point value (where the fractional part represents a fraction of a day) from day representation to second representation, then trunc cuts off the remaining fraction of a second. If you want an integer representation of milliseconds then also multiply your timestamp value with 1000 before calling trunc.
Note that this is not yet the same as having an actual time stamp value with ms resolution as mentioned by guest and Thaddy.
I have used Now() with DecodeTime() on a modest laptop with Linux to time stamp text log entries and achieved a resolution of 10 - 20 ms (of course this includes the text formatting and time conversion overhead).