Given year, month and day, all in int, how would I generate an NSDate

Posted by BU on Stack Overflow See other posts from Stack Overflow or by BU
Published on 2010-03-16T04:49:07Z Indexed on 2010/03/16 5:16 UTC
Read the original article Hit count: 543

Filed under:
|
|
|
|

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.

Thanks in advance for your help.

© Stack Overflow or respective owner

Related posts about nsdate

Related posts about int