NSDate的日期名称? [英] Day Name From NSDate?

查看:90
本文介绍了NSDate的日期名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iPhone应用程序中显示日期的名称,但我找不到解决方案。
感谢您的帮助

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

推荐答案

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

您在区域设置中获得 dayName 用户。

You get dayName in the locale of the user.

(查看 Unicode标准对于日期格式样本)

(check Unicode standards for date formats samples)

这篇关于NSDate的日期名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆