Amazon.com Widgets NSDate Acting funny
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2013, 09:50:38 PM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Programming in Objective-C, 4th edition
| |-+  General Discussion
| | |-+  NSDate Acting funny
Pages: [1]   Go Down
Print
Author Topic: NSDate Acting funny  (Read 540 times)
Withan
Newbie
*
Posts: 1






« on: July 10, 2012, 06:01:27 PM »

I'm just beginning to learn Objective-C. While playing with NSDate, I got a funny result:

int main(int argc, const char * argv[])
{

    @autoreleasepool {
       
        NSDate *date = [NSDate date];
        NSLog (@"today is %@",date);
       
       
    }
    return 0;
}

returned: 2012-07-10 19:59:30.396 DateFun[29934:403] today is 2012-07-11 00:59:30 +0000

"NSDate *date = [NSDate dateWithTimeIntervalSinceNow: 0];" Got the same result. Why is it returning tomorrow's date?
Logged
mlconnell
Newbie
*
Posts: 6


Email




« Reply #1 on: August 02, 2012, 04:11:02 PM »

Stupid question but is your date correct on your mac or pc??

Logged
happyzhb
Administrator
Newbie
*****
Posts: 47


Email




« Reply #2 on: November 11, 2012, 07:51:10 AM »

Could it be related to your time zone?
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.