Output ISO8601 date string from seconds and nanoseconds One reason why ISO8601 is the best date string format, is that you can simply append as much precision as you like. Given 2 integers representing seconds and nanoseconds that have passed since 1970-01-01T00:00:00, return an ISO8601 string as described below.
Output:
The standard output format without timezone looks like this:
1970-01-01T00:00:00.000001
The date is encoded as &quot;year, month,day&quot; with 4,2,2 digits respectively, separated by a &quot;-&quot;. The time of day is encoded as &quot;hour, minute, seconds&quot; with 2,2,2 digits respectively. Then, optionally a dot with exactly 6 digits of precision can follow, encoding microseconds that have passed after the given date+(time in hours+minutes+seconds) since. This is only appended if it'd be not equal to 000000. See examples below
Yes, we are allowed to append 6 digits(microseconds) of precision and theoretically more are simply appendable,  though not defined further in the standard.
Input:
You'll get 2 integers(seconds, nanoseconds). For the sake of simplicity, let's constrain them to be within 0 &lt;= x &lt; 10^9 both. Make sure to discard/round down any precision beyond microseconds.
Examples:
Input: 616166982 , 34699909     Output: 1989-07-11T13:29:42.034699
Input: 982773555 , 886139278    Output: 2001-02-21T16:39:15.886139
Input: 885454423 , 561869693    Output: 1998-01-22T07:33:43.561869
Input: 0         , 100000       Output: 1970-01-01T00:00:00.000100
Input: 0         , 1000         Output: 1970-01-01T00:00:00.000001
Input: 0         , 999          Output: 1970-01-01T00:00:00
Input: 999999999 , 999999999    Output: 2001-09-09T01:46:39.999999

Task:
Provide a function that takes in 2 integers as described in the Input section and returns a String as described in the Output section.
For details and limitations for input/output please refer to the default input/output rules.
This is codegolf: Shortest solution in bytes wins.
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