14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

Time Control<br />

Though I do not know what time and date exactly mean, I did build several conventional functions related<br />

to time and date.<br />

6.1 Digital Clock<br />

6.1.1 Time<br />

time() returns the current system calendar time, which is a double precision number. It is a builtin function.<br />

For example,<br />

> this.parameter("OUTPUT_PRECISION",10);<br />

> time()<br />

815691299<br />

6.1.2 Localtime<br />

localtime() returns a vector of local time with seven components: year, month, day-of-month, day-of-year,<br />

hour, minute, and second. Such a vector will be referred to as time vector (tv). Whereas localtime(t)<br />

converts the calendar time represented by t into the local time vector. It is a builtin function. For example,<br />

> t = time()<br />

8.15692e+08<br />

> localtime()<br />

i = 1 i = 2 i = 3 i = 4 i = 5 i = 6<br />

1995 11 6 3101 4 9<br />

i = 7<br />

13<br />

> localtime(t)<br />

i = 1 i = 2 i = 3 i = 4 i = 5 i = 6<br />

1995 11 6 310 14 9<br />

i = 7<br />

5<br />

41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!