this old iMac.
Is it a really old iMac with System 9.xx installed,
a really old iMac with System 9 and OS X installed,
a quite old iMac with an early version of OS X installed,
an old iMac with a slightly later version of OS X installed
or what?

Lack of details do not help but, if this thing is running OSX, you can reset the passwords by booting the machine from the Restoration CD/DVD that came with it or with any, older, retail version of OS X .

The message you got at first was probably indicating that the date and time were incorrect because the internal battery was dead.

P