Time Library in Arduino 1.0

Help with Time Library...

I have a project where I am already connecting to a NTP server to get the current EPOCH time. This all works great. I would like to set, i.e. synchronize, the Arduino clock, by using the functions in the time library, like...
setTime(t);
where I assume t is EPOCH seconds???

Then, use the time library function, below, to get the hour, minutes, second, day, week, month, year, instead of having to code all the conversions myself.

hour(); // the hour now (0-23)
minute(); // the minute now (0-59)
second(); // the second now (0-59)
day(); // the day now (1-31)
weekday(); // day of the week, Sunday is day 0
month(); // the month now (1-12)
year(); // the full four digit year: (2009, 2010 etc)

However, when I simply add...
#include <Time.h>
to my sketch, I get the following compile errors....

C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:31:19: error: types.h: No such file or directory
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:32:19: error: w5100.h: No such file or directory
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:33:20: error: socket.h: No such file or directory
In file included from C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:37:
C:\arduino-1.0\libraries\Time/UdpBytewise.h:66: error: conflicting return type specified for 'virtual void UdpBytewiseClass::write(uint8_t)'
C:\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:46: error: 'socket' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:61: error: 'recvfrom' was not declared in this scope
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::endPacket()':
C:\arduino-1.0\libraries\Time\UdpBytewise.cpp:106: error: 'sendto' was not declared in this scope

I suspect that some of the *.h files are not being seen, as they are in the Ethernet library directory, but it seems that the Time.h assumes that they are in the Time subdirectroy, via UdpBytewise.cpp.
Also, "types.h" does not exist anywhere.
I enclosed a print.txt file of my libraries directory.
Can anyone help me out here, or is there a newer Time Library that is good for Arduino 1.0?
Also, here is a view of the libraries that I am currently loading into my Sketch. Again, all is good if I comment out the Time.h.

#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
#include <SdFat.h>
#include <SdFatUtil.h>

//stuff added for timer
#include <EthernetUdp.h>
#include <stdlib.h>

//stuf to set the arduino time clock
#include <Time.h>

Thanks for any help.

print.txt (17 KB)

in the time library it self, there are 4 other libraries, so when installing the library, you will acctually install 4 libraries. hope that helps :slight_smile:

so just to recap, theres 4 folders in the time folder, and those 4 folders need to go to your libraries folder :slight_smile:

(there might be 3, i just remember it as 4)

dumle29,
Thanks for the input. If you look at my print.txt of my directories, you will see that 3 directories came with the Time Library...
\libraries\Time
\libraries\TimeAlarms
\libraries\DS1307RTC

I have no idea what that last one is for, however.
What am I missing, and where can I get the latest?

BTW. I have temporarily created and tested my own function to convert Epoch to the current Month\Day\Year hh:mm:ss results. So my need has lessened however it still bugs me that I cannot get this library to work.

Thank again.