Day Name From NSDate?

前端 未结 6 1585
礼貌的吻别
礼貌的吻别 2020-12-15 16:29

I would like to show the name of day in my iPhone application and i don\'t found the solution. Thanks for help

6条回答
  •  情书的邮戳
    2020-12-15 16:54

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"EEEE"];
    NSString *dayName = [dateFormatter stringFromDate:yourDate];
    [dateFormatter release];
    

    You get dayName in the locale of the user.

    (check Unicode standards for date formats samples)

提交回复
热议问题