iphone - 来自 NSDate 的日期名称?

标签 iphone objective-c ios4

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

最佳答案

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

您会在用户的语言环境中获得 dayName

(查看 Unicode standards 获取日期格式示例)

关于iphone - 来自 NSDate 的日期名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4745110/

相关文章:

iphone - 在 uitableview 中删除行

iphone - 通过代码切换 iPhone 网络共享

ios - unregisterForRemoteNotifications 不适用于 iOS8 - 推送通知

iphone - 从 Objective-C 类文件访问 ViewController 的成员/属性的正确方法?

iphone - 如何通过点击 detailDiclosureButton 获取详细信息

iphone - 是否可以本地化应用程序图标和 Default.png?

iOS 在从外围设备传入 BLE 连接时停止唤醒应用程序

从 XIB 加载的 iOS UITableView header

objective-c - 比较两个nsstrings的值

iphone - 替代 UIImage 的 imageWithCGImage :scale:orientation: