தேதி சேர்த்தல்
Swift
xxxxxxxxxx
let monthsToAdd = 2
let daysToAdd = 1
let yearsToAdd = 1
let currentDate = Date()
var dateComponent = DateComponents()
dateComponent.month = monthsToAdd
dateComponent.day = daysToAdd
dateComponent.year = yearsToAdd
let futureDate = Calendar.current.date(byAdding: dateComponent, to: currentDate)
print(currentDate)
print(futureDate!)
தேதி மற்றும் நேரத்தைச் சேர்த்தல்
Swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad()
{
super.viewDidLoad()
let monthsToAdd = 2
let daysToAdd = 1
let yearsToAdd = 1
let currentDate = getCurrentDate()
var dateComponent = DateComponents()
dateComponent.month = monthsToAdd
dateComponent.day = daysToAdd
dateComponent.year = yearsToAdd
let futureDate = Calendar.current.date(byAdding: dateComponent, to: currentDate)
print(currentDate)
print(futureDate!)
}
func getCurrentDate()-> Date {
var now = Date()
var nowComponents = DateComponents()
let calendar = Calendar.current
nowComponents.year = Calendar.current.component(.year, from: now)
nowComponents.month = Calendar.current.component(.month, from: now)
nowComponents.day = Calendar.current.component(.day, from: now)
nowComponents.hour = Calendar.current.component(.hour, from: now)
nowComponents.minute = Calendar.current.component(.minute, from: now)
nowComponents.second = Calendar.current.component(.second, from: now)
nowComponents.timeZone = NSTimeZone.local
now = calendar.date(from: nowComponents)!
return now as Date
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
Linux - anc-api-tools ஐ எவ்வாறு நிறுவுவது
Linux - curvedns ஐ எவ்வாறு நிறுவுவது
Linux - zenmap ஐ எவ்வாறு நிறுவுவது
Python - ஒரு எண் நேர்மறை, எதிர்மறை அல்லது 0 என்பதைச் சரிபார்க்கவும்
C - ஒரு முழு எண்ணில் உள்ள இலக்கங்களின் எண்ணிக்கையை எண்ணுங்கள்
C - டைனமிக் மெமரி ஒதுக்கீட்டைப் பயன்படுத்தி மிகப்பெரிய எண்ணைக் கண்டறியவும்
Python - எக்செல் (XLSX) கோப்புகளை எழுதுதல்
Kotlin - ஒரு எண்ணைத் தலைகீழாக மாற்றவும்
C++ - ஒரு எண் முதன்மையானதா இல்லையா என்பதைச் சரிபார்க்கவும்
Kotlin - ஒரு எண்ணின் காரணியைக் கண்டறியவும்
Linux - zstd ஐ எவ்வாறு நிறுவுவது
JavaScript - ஒரு சரம் சில எழுத்துகளுடன் தொடங்குகிறதா மற்றும் முடிவடைகிறதா என்பதைச் சரிபார்க்கவும்
Python - குமிழி வரிசை
C++ - அளவு மற்றும் மீதமுள்ளவற்றைக் கண்டறியவும்
Linux - xbitmaps ஐ எவ்வாறு நிறுவுவது
C++ - லீப் ஆண்டைச் சரிபார்க்கவும்
Java - ஒரு எண்ணைத் தலைகீழாக மாற்றவும்
Kotlin - ஒரு எண்ணிலிருந்து n தசம இடங்களுக்குச் சுற்று
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month