I am using Stata/SE 17.0 for Mac (Apple Silicon, Revision 05 Oct 2021) with a trivial example. My raw data (these are bid-ask spreads) look as follows
Code:
 
2021-11-23 17:45:00.154 64 UP 249,85 249,95 147
2021-11-23 17:35:16.634 UP 249,45 1.837
2021-11-23 17:35:16.634 UP 249,45 1.694
2021-11-23 17:35:16.633 UP 249,45 1.037
No, I use the usual way to convert the timestamp, for example I do
Code:
gen double timestamp=clock(var1, "YMDhms")
format timestamp %tc
and indeed I get
Code:
var1    bid    ask    spread    timestamp
2021-11-15 09:00:13.058    253.5    254.75    1.25    15nov2021 09:00:13
2021-11-15 09:00:13.140    253.75    253.8    .05    15nov2021 09:00:13
2021-11-15 09:00:13.140    253.8    254.65    .85    15nov2021 09:00:13
As can be seen the milliseconds from the string variable are probably not converted to Stata. In particular, the following shows this
Code:
 tsset timestamp
repeated time values in sample
Does anyone know what to do?