-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.
  • 109
  • 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,035
  • 3
  • 55
  • 79
rob mayoff
  • 358,182
  • 62
  • 756
  • 811