Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func getCurrentTime(){
- let now = Date()
- let dateformatter = DateFormatter()
- // 設定時間格式
- dateformatter.dateFormat = "YYYY年MM月dd日 HH點mm分"
- // 將時間轉換成字符串
- let currentTime = dateformatter.string(from: now)
- currentTimeLabel.text = currentTime
- }
Add Comment
Please, Sign In to add comment