• UIDatePicker的时间选择器里的时区的问题


    转自:http://www.cocoachina.com/bbs/simple/?t70445.html

    初始化代码:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view from its nib.
        
        NSDate *now = [NSDate date];
        [_datePicker setDate:now animated:NO];
    }

    显示代码:

    - (IBAction)buttonPressed
    {
        NSDate *selected = [_datePicker date];
        
        NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
        [dateFormat setDateFormat:@"yyyy-MM-dd HH:mm"];
        NSString *theDate = [dateFormat stringFromDate:selected];
        
        NSString *message = [[NSString alloc] initWithFormat:@"The date and time you selected is: %@", theDate];
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Date and Time Selected" message:message delegate:nil cancelButtonTitle:@"Yes, I did." otherButtonTitles:nil];
        [alert show];
    }
  • 相关阅读:
    关于多工序生产中损耗的计算
    ERP相关术语
    linux下如何挂载U盘
    linux boot下的文件
    MPLS简述
    BGP
    linux添加新磁盘
    列表的方法
    python之列表
    python之模块初识-os模块
  • 原文地址:https://www.cnblogs.com/wangpei/p/3185046.html
Copyright © 2020-2023  润新知