Port Time Libraries

Hello, I am trying to port the time library from Arduino so that I can use the Spark core to power a new PlotClock I just printed and assembled(http://www.thingiverse.com/thing:248009). I have most of the code put together, but I am new to programming Arduino’s, so I am unsure how to proceed due to the error. The code uses both server.h and time.h, but time.h is not a library I can import. Here is the error I am seeing (from time.h):

Time.cpp:50:34: error: 'tmElements_t' has not been declared
Time.cpp:51:17: error: 'tmElements_t' was not declared in this scope
Time.cpp:51:31: error: 'tm' was not declared in this scope
Time.cpp:56:1: error: 'timeStatus_t' does not name a type
Time.cpp:57:23: error: variable or field 'setSyncProvider' declared void
Time.cpp:57:23: error: 'getExternalTime' was not declared in this scope
In file included from Time.cpp:39:0:
Time.h:139:33: error: 'time_t makeTime(tmElements_t&)' redeclared as different kind of symbol
Time.cpp:51:8: error: previous declaration of 'time_t makeTime'
Time.cpp: In function 'time_t makeTime(tmElements_t&)':
Time.cpp:207:33: error: 'time_t makeTime(tmElements_t&)' redeclared as different kind of symbol
Time.cpp:51:8: error: previous declaration of 'time_t makeTime'
Time.cpp: In function 'void setTime(int, int, int, int, int, int)':
Time.cpp:300:22: error: 'makeTime' cannot be used as a function
make: *** [Time.o] Error 1

I was hoping I might be able to pick the collective mind of Spark users to figure out a solution to this problem.

I am working on a new time library for :spark: for at least until the :spark: team gives us access to RTC in CPU.

I didn’t choose to port the Arduino time library because NTP time should always be available on the :spark: core and I felt that the time library lacked some things, such as daylight savings time handling and Arduino-style Strings. While I have used the DS1307-type RTC’s in the past, I don’t think the core needs one.

My new library lets you select the refresh interval for NTP updates and handles the NTP kiss-of-death signal.

I hope to release it very soon–I am currently tracking down a bug in the daylight savings time code.

Awesome. It will be good to get this little app working with the hardware. Nice little demo piece.

I have put this up now-see this thread:

Real Time Clock Library for Spark