Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
Batch Artist
- Posts: 22
- Joined: 18 Oct 2013 05:28
#1
Post
by Batch Artist » 20 Oct 2013 04:17
Hello guys, just a little point out here since I constantly get asked how to make a clock or a mechanism that shows you the time and/or date. The following codes are examples:Code: Select all
@ECHO off
ECHO The time is %time%
ECHO The date is %date%
As you can see, Time and date variables are already existent, so there is no need to create variables or make huge lines of code to display time and date. Using the preset variables uses less time, and is very VERY simple to use!
Hope this helps!
.Batch Artist.
-
Batch Artist
- Posts: 22
- Joined: 18 Oct 2013 05:28
#3
Post
by Batch Artist » 25 Oct 2013 05:36
Adrianvdh wrote:How about one the ticks?
Code: Select all
@echo off
:loop
cls
echo %time%
goto loop
Very true, and you can also add colouring into it aswell. E.G...
Code: Select all
@echo off
:Loop
CLS
ECHO %time%
color A
color B
color C
color D
color E
color F
color 9
GOTO Loop