next up previous contents index
Next: text_lines Up: Miscellaneous Previous: ask

Time and date

In time.cecil:


method current_time():int; 
method real_time(cl:&():void):int; 
template object date_info isa comparable[date_info]; 
method new_date_info(time:int):date_info; 
method date():date_info; 
method =(d1@:date_info, d2@:date_info):bool; 
method seconds(d@:date_info):int; 
method minutes(d@:date_info):int; 
method hours(d@:date_info):int; 
method day_of_month(d@:date_info):int; 
method month_of_year(d@:date_info):int; 
method month_of_year_name(d@:date_info):string; 
method month_of_year_shortname(d@:date_info):string; 
method year(d@:date_info):int; 
method day_of_week(d@:date_info):int; 
method day_of_week_name(d@:date_info):string; 
method day_of_week_shortname(d@:date_info):string; 
method day_of_year(d@:date_info):int; 
method is_daylight_savings_time(d@:date_info):bool; 
method time_zone_name(d@:date_info):string; 
method gmt_offset(d@:date_info):int; 
method print_string(d@:date_info):string; 
The date_info object provides hygienic access to the current_time function. A new date_info representing the current time is returned by the date function; a date_info object for a given time is constructed by the new_date_info method. Many aspects of the current time and date can be queried; the _shortname versions return 3-letter abbreviations of their _name equivalents. The numbers returned are zero-based (i.e., January is month 0 and Sunday is day 0). The print_string output for a date_info object is identical to the output of the Unix date command.


next up previous contents index
Next: text_lines Up: Miscellaneous Previous: ask

The Cecil project