Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: dateFromString issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dateFromString issue



Sure looks like a time zone offset to me.  Just guessing.

On Jul 13, 2011, at 6:21 PM, Tonny wrote:

hi, all
thanks advance

i met a dateFromString issue, is there something wrong?

    NSString *dateString = @"2011-07-14 09:09:11"; 

    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSDate *date = [formatter dateFromString:dateString];
    [formatter release];

    NSLog(@"Date : %@",date);

but i got ---------->   Date :  2011-07-14 01:09:11 +0000

-- 
Tonny
Sent with Sparrow
Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >dateFromString issue (From: Tonny <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.