new date js split T and Z code example Example: javascript toisostring without milliseconds console.log( now.toISOString().split('.')[0]+"Z" );