Move to Position ESC[row;colH Move the cursor to the (col, row) position. Note that the row comes before column; that is, y comes before x. Either col or row can be omitted. Row and column both start with "1," not zero. (1, 1) corresponds to the top-left corner of the screen.
Clear Screen ESC[2J Clear the whole screen and position the cursor to the top left corner.
"/033[1H/033[2J"相當於ESC[1H ESC[2J,就是說把光標移到左上角,然後清屏
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t timer;
struct tm *tblock;
/* gets time of day */
timer = time(NULL);
/* converts date/time to a structure */
tblock = localtime(&timer);
printf("Local time is: %s", asctime(tblock));
return 0;
}