Concept Framework 2.2 documentation Contents | Index

standard.C.time.ctime

Name Version Deprecated
ctime version 1.0 no

Prototype:
string ctime(number timer)

Parameters:
timer      [in] time

Description:
A string result. An empty string will be returned if:

time represents a date before midnight, January 1, 1970, UTC.
time represents a date after 19:14:07 January 18, 2038.

The timer value is usually obtained from a call to time, which returns the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time (UTC). The return value string contains exactly 26 characters and has the form:

Wed Jan 02 02:03:55 1980\n\0

A 24-hour clock is used. All fields have a constant width. The newline character ('\n') and the null character ('\0') occupy the last two positions of the string.

The converted character string is also adjusted according to the local time zone settings.

Example:
import standard.C.time

class Main {
     function Main() {
          echo "Local time and date are : " + ctime(time());
     }
}
 

Results 
Local time and date are : Sat Mar 11 02:12:37 2006  

Returns:
A string result. An empty string will be returned if: time represents a date before midnight, January 1, 1970, UTC. time represents a date after 19:14:07 January 18, 2038

Documented by Simona Gabriela Plesuvu, generation time: Sun Jan 27 18:15:15 2013 GMT(c)2013 Devronium Applications