Hi Lets see the simple code to get current time
//Get current date
NSDate *date = [NSDate date];
// format it
NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init];
[dateFormat setDateFormat:@"MMM dd, yyyy"];
// convert it to a string
NSString *dateString = [dateFormat stringFromDate:date];
// free up memory
[dateFormat release];
//Try it
NSLog(@"Todays date is = %@",dateString);
This is what i got :
Todays date is = Aug 28, 2012
Thanks for sharing your info. I truly appreciate your efforts and I will be waiting for your next write ups thanks once again.
ReplyDeleteandroid mobile app development services in Sahiwal