Getting current time

后端 未结 3 1922
情话喂你
情话喂你 2021-01-25 15:06

I\'m trying to get current hour minutes and seconds. Here is the code I use

NSDate *now = [NSDate date];

NSCalendar *gregorian = [[NSCalendar  alloc]initWithCal         


        
3条回答
  •  太阳男子
    2021-01-25 15:30

    Just doing

        NSDate *datenow = [NSDate date];
    

    you will have the current date and time, to generate string representations of a date, you should use an instance of NSDateFormatter.

提交回复
热议问题