In Back to the Future II, on November 12 1955 the DeLorean with Doc in it gets struck by a bolt of lightning, sending him back to 12 AM 1 January 1885. The potential for this is alluded to previously when we see the time circuits flickering to this date. I can understand why the time circuits would default to 12 AM because in 24 hour time that's 00:00. I can also understand why it would default to 1st of January, because that's the beginning of a year. So far so good; the time circuits are defaulting to a 'base' time (i.e. the beginning). What I don't understand though is why did the year default to 1885? Surely it would make more sense for the year value to default to the year '0000', or '1900' or some other such date which marks the beginning of a century or millennium.
Digital time is stored as an offset from some date and time in the past, known as an epoch. For example, on MS Windows computers, the current time is measured as the number of nanoseconds since January 1, 1601.
Doc Brown must have chosen 1885 as the epoch for the clock in the time machine, and thus year 0 for the machine is actually 1885 on the Gregorian calendar.
Now, why he choose 1885 as day 0 for the clock we may never know.
If I remember correctly from the last scene in BttF 2:
The DeLorean is suspended in the air, with Doc inside, under a storm with very intense wind and debris moving around. The time circuit is set to 1985, but then something hits the car and this provokes a small glitch in the circuit, which causes the second digit to change from 9 to 8. Before Doc has had time of ever noticing it, the bolt strikes the car.
Now, as far as how real electronic devices work, this doesn't make much sense as indeed, such a situation would have provoked the circuit to go to 0 or any other more reasonable default. So think of it as a small "plot hole" to make it possible the third movie (a very small plot hole compared to the very existence of a time machine!) :-)
The Time Circuits were malfunctioning following the trip to 1985A, causing them to change to January 1, 1885
After "returning" to 1985A (the alternate 'present' where Biff is rich and powerful) and finding out how Biff changed the past, Doc inputs the date NOV 12 1955 so they can go back and change it back to 1985 'Prime'. The time circuit display then blinks and the destination date changes to JAN 01 1885 12:00AM. Since they are currently in the year 1985, this means it is defaulting to 01/01 at 12:00:00 and the year is their current year minus 100. Obviously, whatever malfunction the time circuits were experiencing was performing this subtraction of years. Anything beyond that is purely speculation.
MARTY: Nice one Doc! You're not going to believe this, we've got to go back to 1955!
DOC: I don't believe it!
THE DELOREAN FLIES AWAY FROM PLEASURE PARADISE
MARTY: That's right, Doc. November 12th 1955.
DOC: Unbelievable, that old Biff could have chosen that particular date. It could mean that, that point in time inherently contains some sort of cosmic significance. Almost as if it were the junction point for the entire space-time continuum. On the other hand, it could just be an amazing coincidence.
THE TIME DISPLAY CHANGES TO JAN 01 1885 12.00 AM.
DOC: Damn, gotta fix that thing!
DOC BANGS IT AND IT CHANGES BACK TO NOV 12 1955 06.00 AM
DOC: All right, time circuits on.
MARTY: What do you mean, time circuits on? Doc, we're not going back now?
This malfunction was the reason why, when struck by lightning, the DeLorean was sent back in time to that date.
When Marty receives the letter from the Doc via Western Union right after the DeLorean disappears, it corroborates that the date he was sent to was the same as that on the display when it malfunctioned:
WESTERN UNION MAN: Yeah, 70 years, 2 months and 12 days to be exact. Here, sign on line 6 please, here you are.
HE GIVES MARTY A CLIPBOARD AND MARTY SIGNS ON LINE 6. HE READS TE BOTTOM OF THE LETTER - IT SAYS "'Doc' Emmett L Brown, September 1st 1885".
MARTY: It's from the Doc! (reading) "Dear Marty, if my calculations are correct you will receive this letter immediately after you saw the DeLorean struck by lightning. First let me assure you that I am alive and well. I've been living happily these past eight months in the year 1885. The lightning bolt-" 1885?! (at bottom of letter) "September 1885!" Argh!
Since September 1, 1885 is exactly 8 months after January 1, 1885, we can verify that Doc was sent back to January 1, 1885 as the time display malfunction showed earlier in the movie.
NOTE: That's the best script I could find online, for whatever reason.