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

Time

From FenixWiki

Revision as of 00:26, 30 April 2007 by Sandman (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


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.

Returns

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

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