I think the solution is really simple, I just haven't come across it online.
Suppose I am given int year, int month, int day, int hour, int min, int sec.. how do I generate NSDate out of it?
I know we can use [NSDate initWithString:] but I think it gets complicated if month/day/hour/min/sec are one digit numbers.
Suppose I am given int year, int month, int day, int hour, int min, int sec.. how do I generate NSDate out of it?
Put the ints into an NSDateComponents object, then ask an NSCalendar object to change that into a date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With