- This wiki is out of date, use the continuation of this wiki instead
Time
From FenixWiki
(Difference between revisions)
| Revision as of 00:26, 30 April 2007 (edit) Sandman (Talk | contribs) ← Previous diff |
Current revision (00:37, 30 April 2007) (edit) (undo) Sandman (Talk | contribs) m (Category) |
||
| Line 1: | Line 1: | ||
| [[Category:functions]] | [[Category:functions]] | ||
| - | [[Category: | + | [[Category:time]] |
| ==Definition== | ==Definition== | ||
Current revision
[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,×tring); // 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
