fix calculation of milliseconds

The previous method of appending 000 to the timestamp string failed for the
start of the epoch which became '0000' rather than just '0'.
Merge branch 'feature/elasticsearchevents' into is24-master

* feature/elasticsearchevents:
  fix calculation of milliseconds