Date selector (iOS development)

Source: Internet
Author: User

-(void) viewdidload {    [super viewdidload];    Do any additional setup after loading the view, typically from a nib.} -(void) didreceivememorywarning {    [super didreceivememorywarning];    Dispose of any resources the can be recreated.} -(Ibaction) onclick: (ID) Sender {    NSDate *thedate = self.dataPicker.date;        The Descriptionwithlocale method returns the local time    //Currentlocale returns the current consumer information    NSLog (@ "The date picked is:%@", [thedate Descriptionwithlocale:[nslocale Currentlocale]]);        Sets    the difference between format format/DD and dd    nsdateformatter *dateformatter = [[NSDateFormatter alloc] init];    [Dateformatter setdateformat:@ "Yyyy-mm-dd HH:mm:ss"];        Output    NSLog (@ "The date formate is:%@", [Dateformatter stringfromdate:thedate]);    Self.label.text = [Dateformatter stringfromdate:thedate];    }    

See note: The difference between DD and DD is that DD returns the day ordinal of the current month, and DD returns the day of the year



Date selector (iOS development)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.