0
    
 Lấy thứ trong tuần từ date hoặc date_epoch của file Json
Ví dụ tôi có date: "2018-08-28" và date_epoch: 1535414400 Làm sao tôi có thể lấy được thứ hai, thứ ba, thứ tư từ 2 điều kiện trên?
            Thêm một bình luận
         
1 CÂU TRẢ LỜI
        +7
    
 Bạn thử dùng dateFormatter nhé.
let epochTime: TimeInterval = 1535414400
        let date = Date(timeIntervalSince1970: epochTime)
        
        let dateFormatter = DateFormatter()
        dateFormatter.dateFormat = "EEEE, dd-MM-yyyy"
        let currentDateString: String = dateFormatter.string(from: date)
        print(currentDateString)
Hay lắm anh.
 
  
  
 
