How to get current date and time in Swift (NSDate, Date, DateFormatter)
Hello everyone! I'm a complete beginner in Swift, writing my first iOS app. I need to get the current system date and time to display them on the screen or save to a database. I've dug through tons of articles, but everywhere the examples are in Objective-C with NSDate, while I'm writing in Swift. I tried writing like this:
```swift
let currentTime = NSDate()
print(currentTime)
```
But the console outputs something strange: `2024-01-15 14:30:00 +0000`. I want to get normal time in the format "January 15, 2024, 14:30:00", not this string with GMT. Also, I heard that in Swift 3 and above a new `Date` type appeared, but I don't understand how it differs from the old `NSDate`. How do I correctly get the current time? Do I need to use DateFormatter? And how do I change the timezone so the time is Moscow time? Please explain with examples.