-4

Is there any way to get some kind of current date/time info converted to string in one line of code in Swift?

Andrew L.
  • 111
  • 1
  • 11

1 Answers1

2

If you just want the current date and time as a string, and you really don’t care about the time zone or the format in any way, this will do:

let nowString = "\(Date())"
TheTiger
  • 13,264
  • 3
  • 57
  • 82
rob mayoff
  • 375,296
  • 67
  • 796
  • 848