tl;dr
Instant // Represent a moment as a count since the epoch reference of 1970-01-01T00:00Z.
.ofEpochSecond( // Instantiate a `Instant` as a count of whole seconds plus fractional second.
TimeUnit.MICROSECONDS.toSeconds( microseconds ) , // Count of whole seconds since the epoch reference.
TimeUnit.MICROSECONDS.toNanos( microseconds ) // Calculate fractional second as a count of nanoseconds.
-
TimeUnit.SECONDS.toNanos(
TimeUnit.MICROSECONDS.toSeconds( microseconds )
)
) // Returns an `Instant`.
.toString() // Generate text in standard ISO 8601 format.
.replace( "T" , " " ) // Replace a `T` with a SPACE for desired output format.
.replace( "Z" , "" ) // Remove the `Z` from the end, that indicates the date and time is in the context of UTC.
Avoid legacy date-time classes
You are using terrible date-time classes that were supplanted years ago by the modern java.time classes defined in JSR 310.
Furthermore, as others indicated, the legacy classes cannot accommodate microseconds, only milliseconds. Well, actually, the legacy class java.sql.Timestamp
attempts to represent nanoseconds, but does so by way of a terrible hack that includes a fractional second in milliseconds and a fractional second of nanoseconds (a real mess).
java.time

Sample data
For a demo, let's create the sample number of microseconds since the first moment of 1970 in UTC.
// Convert to microseconds. Use as input value to further code below.
Instant instantPrime = Instant.now().truncatedTo( ChronoUnit.MICROS ); // Drop any nanoseconds, to keep only microseconds.
long wholeSecondsPrime = instantPrime.getEpochSecond();
long nanoAdjustmentPrime = instantPrime.getNano();
long microseconds =
TimeUnit.SECONDS.toMicros( wholeSecondsPrime ) +
TimeUnit.NANOSECONDS.toMicros( nanoAdjustmentPrime )
;
Processing
Let's chop that count of microseconds into two parts, a number of whole seconds since 1970-01-01T00:00Z, and a fractional second as a number of microseconds.
// Convert from microseconds.
long wholeSeconds = TimeUnit.MICROSECONDS.toSeconds( microseconds );
long nanoAdjustment = TimeUnit.MICROSECONDS.toNanos( microseconds ) - TimeUnit.SECONDS.toNanos( wholeSeconds );
Put them back together again.
Instant instant = Instant.ofEpochSecond( wholeSeconds , nanoAdjustment );
boolean match = instant.equals( instantPrime );
Dump to console.
System.out.println( "instantPrime = " + instantPrime );
System.out.println( "wholeSecondsPrime = " + wholeSecondsPrime );
System.out.println( "nanoAdjustmentPrime = " + nanoAdjustmentPrime );
System.out.println( "microseconds = " + microseconds );
System.out.println( "wholeSeconds = " + wholeSeconds );
System.out.println( "nanoAdjustment = " + nanoAdjustment );
System.out.println( "instant = " + instant );
System.out.println( "match = " + match );
instantPrime = 2020-01-07T23:32:26.385565Z
wholeSecondsPrime = 1578439946
nanoAdjustmentPrime = 385565000
microseconds = 1578439946385565
wholeSeconds = 1578439946
nanoAdjustment = 385565000
instant = 2020-01-07T23:32:26.385565Z
match = true
Strings
Generate text representing the value of your Instant
using standard ISO 8601 format.
String output = instant.toString() ;
2020-01-07T23:32:26.385565Z
Your desired format is close to that. Replace the T
with a SPACE. And remove the Z
, though be careful about that. Presenting date-time as text without indicating the time zone or offset-from-UTC can create ambiguity and confusing for the reader. I would recommend including the Z
.
String output = instant.toString().replace( "T" , " " ).replace( "Z" , "" ) ;
2020-01-07 23:32:26.385565
About java.time
The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date
, Calendar
, & SimpleDateFormat
.
To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations. Specification is JSR 310.
The Joda-Time project, now in maintenance mode, advises migration to the java.time classes.
You may exchange java.time objects directly with your database. Use a JDBC driver compliant with JDBC 4.2 or later. No need for strings, no need for java.sql.*
classes.
Where to obtain the java.time classes?
The ThreeTen-Extra project extends java.time with additional classes. This project is a proving ground for possible future additions to java.time. You may find some useful classes here such as Interval
, YearWeek
, YearQuarter
, and more.