English 中文(简体)
1. 麦克风发展中国家囚犯的准确日期和日期比较日期?
原标题:Accurate date formate and compare date in iphone dev?
  • 时间:2011-10-18 06:40:48
  •  标签:
  • iphone

我说的是新话,即希望把描述变成准确的日期,即过去2个小时没有这样做。 我像(10月17日:3018日)一样,希望把这个日期准确无误地改写,如果在明天仅显示10月18日,如果今天仅显示时间17:30,则要把这个日期与明天进行比较。

问题回答

缩略语

    NSString *dateString = @"6:30 18 Oct";
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"hh:mm dd/MMM"];
    NSDate *dateFromString = [[NSDate alloc] init];
    dateFromString = [dateFormatter dateFromString:dateString];
    [dateFormatter release];

Try this

    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"hh:mma dd/MMM"];
    NSString *dateString = [dateFormat stringFromDate:today];
    NSLog(@"date: %@", dateString);
    [dateFormat release];




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签