This wiki is out of date, use the continuation of this wiki instead

Time

From FenixWiki

Jump to: navigation, search


[edit] Definition

INT time ( )

Returns the current time, in seconds from January 1st, 1970.

This function is mostly useful for the function ftime(), to display time and date in a particular format.

[edit] Returns

INT : The current time, in seconds from January 1st, 1970.

[edit] Example

Program currenttime;
Private
    String timestring; // The string holding the formatted time
Begin

    write_string(0,0,0,0,&timestring); // Display the timestring
    timer = 100; // Make it so it updates the timestring immediately

    Repeat
    	if(timer>100) // Update the timestring every 1 second
            timer = 0;
            timestring = ftime("%d-%m-%Y %H:%M:%S",time());
        end
        frame;
    Until(key(_esc))

End

Used in example: write_string(), ftime(), key(), timer

Personal tools