0
我在我看来有两个日期选择器。 其中一种具有日期模式,一种具有时间模式。在按下另一个按钮时,我希望能够获取日期选择器和时间选择器的值,并将它们合并为一个时期。剥离时间截止日期选择器和日期时间选择器快速
到目前为止,我已经试图剥离休息时间的日期选择器,像这样:
let dFormat = DateFormatter()
dFormat.dateFormat = "MMM dd yyyy"
let dateString = dFormat.string(from: datePicker.date)
let dateObj = dFormat.date(from: dateString)
let epochDate = dateObj?.timeIntervalSince1970
print ("date is \(epochDate)")
但我还是我得到当前的时间与它一起去。我需要它是00:00,因为我会再从我的塞康选择器加我划时代VAL这种为了得到所需的联合划时代