I have a syntek mini dvr and I need to know how to set time and date
The instructions in the "Time Set" directory on the supplied mini-CD say to run the "time.bat" file, then copy the resulting "time.txt" file to the root directory of the device.
That will not work if your Windows is set to the US locale for date/time! Many other locales probably won't work either. Apparently the "time.bat" file was only developed for and/or tested under the China locale. The resulting "time.txt" file will not be in the proper format nor contain a valid date and time if generated by their "time.bat" in the wrong locales!
It will only work if, at a Command Prompt (Start/Run "cmd") on your system, "echo %date%" returns a date in the format "2010-12-31 Fri" (where "12" is a month number [December in this case] and "31" is a day number - any punctuation is acceptable - it need not be hyphens). US systems generally return "Fri 12/31/2010" for the same date, which will not work for this.
Instead, one way is to simply manually create a "time.txt" file in the format shown in the instructions. It consists of a single line in the format:
This would be for 12:34:56 PM on December 23rd, 2010, for instance.
Copy that file (which must be named "time.txt" and nothing else!) into the root directory, then Safely Remove, power it off, unplug it, eject and re-insert the SD card, turn it back on, and press the "Record" button and record a few seconds.
If you're brave, you can edit the "time.bat" file to properly handle your system. Open it into any text or code editor (NotePad will do) and look down about a dozen lines. You'll see these lines:
Change the last four lines in that group to read as follows (for US dates) - changed digits are boldfaced:
The syntax "set yy=%b:~10,4%" means "In the variable b (which contains the system date string as assigned in the previous line, "set b=%date%"), start at Character #10 (where the leftmost / first character is considered to be Character #0, not Character #1!), extract the 4 characters beginning with that one, and assign them to the variable yy."
The variable "yy" needs the four-digit year in the Common Era (aka "C.E." or "A.D."), "zz" the month (zero-padded to two digits), and "dd" the day (ditto). "xx" is assigned the three-letter abbreviated weekday, but that isn't actually copied to the "time.txt" file so there's no need to really worry about that line.
For most locales, it should suffice to simply change the starting position of the respective substring (the number between the tilde ["~"] and the comma [","]), as I did above.
The %time% string is earlier assigned to variable "a" and broken down into 24-hour hour (hh), minute (mm), and second (ss), but those should be pretty much the same in most locales. The code there shouldn't need to be modified, unless your locale returns %time% in some other format than "hh:mm:ss.cc" where "cc" is hundreths of a second. Again, the punctuation doesn't matter: it doesn't have to be colons (":"). Only the positioning matters.
To adapt this to another locale, simply execute "echo %date%" at your Command Prompt and analyze it to find the starting positions of the Year, Month, and Day (remember to start counting the characters at zero instead of one!), then change the above lines accordingly.
Feb 11, 2010 |