LCD Clock

I've been trying to make a small clock using LCD That I believe has been wired and breadboarded correctly. I used this code, but I get an error that says, "DateTime was not declared in this scope".

My Code:

#include <LiquidCrystal.h>
#include <DateTime.h>

// simple sketch to display a digital clock on an LCD
// see the LiquidCrystal documentation for more info on this

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup(){
DateTime.sync(1230768000); // set jan 1 2009 as the default time
}

void loop(){
if(DateTime.available()) {
unsigned long prevtime = DateTime.now();
while( prevtime == DateTime.now() ) // wait for the second to rollover
;
DateTime.available(); //refresh the Date and time properties
digitalClockDisplay( ); // update digital clock
}
}

void printDigits(byte digits){
// utility function for digital clock display: prints preceding colon and leading 0
lcd.print(":");
if(digits < 10)
lcd.print('0');
lcd.print(digits,DEC);
}

void digitalClockDisplay(){
lcd.home();
// digital clock display of current time
lcd.print(DateTime.Hour,DEC);
printDigits(DateTime.Minute);
printDigits(DateTime.Second);
}

Do you have the DateTime library?

To be honest, I don't know.

TheStone:
To be honest, I don't know.

That'll be a "no" then, since it's not a standard library and you would know if you had installed it.

I get the exact same message trying to compile your code and I don't have that library.

How do I get that library, then?

TheStone:
How do I get that library, then?

Over 12 million Google hits for "datetime.h" and the first one's a winner....

http://playground.arduino.cc/Code/dateTime

I have it downloaded, as well as the new version, but I still get the error. is there something I have to do after downloading?

You probably have it unzipped at the wrong level.

When I unzipped it into the library folder I got datetime inside datetime, which is an extra level. If you got that you need to do away with the outer datetime folder and move everything up one level.