Output ISO8601 date string from seconds and nanoseconds
Bash + sed, 37, 59, 50 bytes


printf '%(%FT%T)T.%06d' $1 $[$2/1000]


printf &quot;%(%FT%T)T.%06d&quot; $1 ${2::-3}|sed s/\\.0*$//

Try it online!
8 bytes saved thanks to @DigitalTrauma