Try this:
dt[, day:=as.POSIXct(trunc(ts, 'days')) ]
From ?data.table
POSIXlt is not supported as a column type because it uses 40 bytes to
store a single datetime. Unexpected errors may occur if you manage to create
a column of type POSIXlt. Please see NEWS for 1.6.3, and IDateTime instead.