Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Current and Updating time in iOS?

i'm developing a tool for car driving which saves GPS Data, Accelerometer Data and Time for later use.

Acceleration is the least Priority, though.

All i need is a little code example so i can get the current system time printed as an updating clock in Xcode because i want it to save my data as fast and as often as possible :>

Thanks in advance for any answers :)

h4wkeye

like image 439
h4wkeye Avatar asked Apr 12 '11 10:04

h4wkeye


Video Answer


1 Answers

To get the current system time use

NSDate* currentDate = [NSDate date];

and To get the string representation of NSDate

- (NSString *)description

Then Use below

NSString* dateInString = [currentDate description];
like image 115
Jhaliya - Praveen Sharma Avatar answered Sep 29 '22 21:09

Jhaliya - Praveen Sharma