Last active
January 16, 2017 07:29
-
-
Save fozoglu/c12779ea2e837f5314984da3950bd1b3 to your computer and use it in GitHub Desktop.
Cihazın Günü ve Saatini alan metot örneği
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getDateAndTime() -> (String,String) { | |
let formatterDate = DateFormatter() | |
let formatterTime = DateFormatter() | |
formatterDate.dateFormat = "dd/MM/yyyy" | |
formatterTime.dateFormat = "HH:mm" | |
let currentDate = Date() | |
let date = formatterDate.string(from:currentDate) | |
let time = formatterTime.string(from: currentDate) | |
print("Date : \(date)") | |
print("Time : \(time)") | |
return (date,time) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment