On Fri, 6 Nov 2020 01:01:40 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> char tmp[10 + 1]; >> snprintf(tmp, sizeof(tmp), "%.3d", millisecs); >> snprintf(tbuf, ltbuf, "%s.%s %s", timestamp_date_time, tmp, >> timestamp_timezone); >> This also gets the same thing. > > The concern is when it is less than 100ms. unsigned millisecs[] = { 2, 20, 200, 1000 }; get_time_stamp(millisecs[i], buf, sizeof(buf)); gets: timestamp 06.11.2020 06:56:08.002 EST timestamp 06.11.2020 06:56:08.020 EST timestamp 06.11.2020 06:56:08.200 EST timestamp 06.11.2020 06:56:08.1000 EST with char tmp[10 + 1]; snprintf(tmp, sizeof(tmp), "%.3d", millisecs); snprintf(tbuf, ltbuf, "%s.%s %s", timestamp_date_time, tmp, timestamp_timezone); Is this what you want? ------------- PR: https://git.openjdk.java.net/jdk/pull/1067