LoginSignup
3
4

More than 5 years have passed since last update.

秒数を hh:mm:ss 形式に変換

Posted at
example
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .positional
formatter.allowedUnits = [.minute,.hour,.second]
let outputString = formatter.string(from: 3601.0)
=> "1:00:01"
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4