Get the server’s current time with Swift 4.X URLSession

i0S Swift Issue

Taking the server’s time when you create an application needs to synchronize the time between the client and server. The following short code will retrieve the server’s time via URLSession.

Usage: Put the code below into any function you want to use.