日期选择器格式问题
我如何解决我得到 2011-07-21 15:55:01 +0000 的问题,但计时已关闭 4 小时,如何删除 +0000?我希望格式为例如。 2011 年 6 月 12 日星期五 下午 1:30
-(IBAction)addButton:(id)sender
{
NSDate *choice = [datepick date];
NSString *words = [[NSString alloc]initWithFormat:@"%@", choice];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Date Chosen
message:words
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[words release];
label.text = words;
textfield.text = words;
}
- (void)viewDidLoad
{
NSDate *now = [[NSDate alloc] init];
[datepick setDate:now animated:YES];
[now release];
datepick.minimumDate = [NSDate date];
[super viewDidLoad];
}
How do i solve the problem where i got 2011-07-21 15:55:01 +0000 , but the timing is off by 4 hr, how do i remove the +0000? And I want the format to be Eg. Friday 12 June 2011 1:30 PM
-(IBAction)addButton:(id)sender
{
NSDate *choice = [datepick date];
NSString *words = [[NSString alloc]initWithFormat:@"%@", choice];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Date Chosen
message:words
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[words release];
label.text = words;
textfield.text = words;
}
- (void)viewDidLoad
{
NSDate *now = [[NSDate alloc] init];
[datepick setDate:now animated:YES];
[now release];
datepick.minimumDate = [NSDate date];
[super viewDidLoad];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处日期格式化程序指南。
Here date formatter guide.