티스토리 뷰
728x90
반응형
날짜 차이 구하기
let myDateComponents = DateComponents(year: 2022, month: 3, day: 01)
let startDate = Calendar.current.date(from: myDateComponents)!
let offsetComps = Calendar.current.dateComponents([.year,.month,.day], from: startDate, to: Date())
if case let (y?, m?, d?) = (offsetComps.year, offsetComps.month, offsetComps.day) {
print("\(y)년 \(m)월 \(d)일 만큼 차이남")
}
TimeIntervalSinceNow
TimeInterval
Locale
Date
DateFormatter
Calendar
DateComponents
iOS
Swift
Xcode
DateCompare
Difference
728x90
반응형
'iOS Swift + UIKit' 카테고리의 다른 글
iOS Swift Email Masking (이메일 마스킹 * 표시 ID 아이디 가리기) (0) | 2022.06.01 |
---|---|
iOS Swift 웹뷰 html 바디 가져오기 (get webview html body tag) (0) | 2022.05.04 |
iOS Swift 앱 안끄고 언어 변경 ( 앱 내 언어 설정 ) (4) | 2021.04.05 |
iOS Swift 다국어 설정 - Code Localizing (0) | 2021.04.02 |
iOS Swift 다국어 설정 - Storyboard Localizing (0) | 2021.04.01 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- TabView
- indicator
- Reject
- 다국어
- 인디케이터
- 프로그레스
- localizing
- presentationcompactadaptation
- Localizations
- Authorization
- 리젝
- ios
- 엑스코드
- 테이블뷰
- AppStore
- swiftUI
- 로컬라이징
- SWIFT
- 스위프트
- permission
- 아이오에스
- custom segment
- SKPayment
- SKProductsRequestDelegate
- Localized
- 심사
- Xcode
- TabBar
- Language
- SKPaymentTransactionObserver
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함