setTime()
The method sets the time.
Synopsis
int setTime(int hour, int minute, int second = 0, int milli = 0);
Parameter
Parameter | Description |
---|---|
hour | The hour. |
minute | The minutes. |
second | The seconds. |
milli | The milliseconds. |
Description
setTime() sets the time. The function setTime() sets the time variable t to the value specified in the argument. The default value of the optional arguments hour , minute, second and milli is zero.
Return Value
The method returns -1 in case of invalid input and otherwise 0.
Example
main()
{
time t;
DebugN("Set the time:", t.setTime(8,30,10,0));
}
Assignment
Time function
Availability
UI,CTRL