iphone - Date formatiing -


This calendar warning when adding an event to a calendar using a calendar event:

  "1 day ago",   

but the form of

  "at the time of the event"   

In my code,

  calendar = [[NSCLonder ALOOC] initWithCalendarIdentifier: NSGorian Calendar]; NSString * cday, * cmonth, * cyer; // Set today today = [[NSDT alloc] Init with introversion now: 1]; // Format the NDAT current day * temp1 = [[NSDateFormatter alloc] init] to show; [Temp1 setDateFormat: @ "dd"]; Cday = [temp1 stringFromDate: today]; NSLog (@ "checking% @", cdi); [Temp1 release];   

Is my code wrong? Can anyone help sort me out?

Maybe there is something to do with time zones, you may be right for the Time Zone property of your NSDateFormatter object. Must set the value. Please set the time zone in the local time zone

  [temp1 setTimeZone: [NSTimeZone systemTimeZone]]; (Or) [temp1 setTimeZone: [NSTimeZone local timezone]];   

Please enter this code:

  NSCalendar * calendar = [[NSCLonder ALOOC] initWithCalendarIdentifier: NSGgorian Calendar]; NSString * cday, * cmonth, * cyer; // Set NSDT today; Today = [Date of NSDT]; // Format the NDAT current day * temp1 = [[NSDateFormatter alloc] init] to show; [Temp1 set time zone: [NSTimeZone local timezone]]; [Temp1 setDateFormat: @ "dd"]; Cday = [temp1 stringFromDate: today]; NSLog (@ "checking% @", cdi); [Temp1 release];    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -