PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/dateN referenceC hash_tablerefersizeOIxNbothIsNC.dateCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOIxNC.dateRICdateOIx,}ÐÐNdatenCstringOIxÉClass date is a wrapper around Unix's notion of time. It is intended to communicate over creation, last-modification dates, etc. Dates might also be useful for agenda systems and systems that represent some kind of database. For example, this manual tool uses date objects to keep track of the last-modification time of cards. Unix time is measured in seconds from the Unix epoch: Jan 1, 1970. Therefore, the granularity of a date object is a second. The first date that can be represented is Jan 1, 1970 and the latest date somewhere in the year 2105 (2 to-the-power 32 - 1 seconds from the epoch). The most important methods are: # <-print_name and <-string which returns a textual representation of the date # <-convert Convert a textual representation into a date object. # ->current Update date object to reflect the current time. # ->before, ->after, ->equal Comparison of dates # <-compare Comparison of dates compatible with `chain ->sort'.CchainsizeOIxIeN$class/pce$M.pce.G.dateeN$class/timer$C.timerEN$class/file$C.fileXnnnsNM.date.G.differenceCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOIxNM.date.G.differenceRIOIx<-ô’N differencenOI x˜Difference relative to the argument date in the specified unit. The value is always rounded downwards. `to' defaults to the epoch. units defaults to seconds. Note that the result is returned as a PCE integer and the maximum value of a PCE integer is not sufficient to represent all time differences in second units. An error (int_range) is generated on overflow. See also ->before, ->equal and ->after.nnnnnsNM.date.S.advanceOI xNM.date.S.advanceRIOI xC NadvancenOI xúAdvance date object with the given amount of the specified unit. The default unit is `second'. Please note that larger units are omitted due to their unclear semantics. Units are converted to seconds. Given that the fields are in local time, creating a time from fields, ->advance and get the fields may yield strange results. For example: ?- new(D, date(0, 0, 0, 30, 10, 2005)), send(D, advance, 1, day), get(D, string, string(Date)) Date = 'Sun Oct 30 23:00:00 2005' See also ->month, etc.nnnnnsNM.date.G.xml_stringOI xNM.date.G.xml_stringRIOIx>ã2‘N xml_stringnOIx<-string in the XML-Schema defined dateTime format. The time is always represented in UTZ (ending with a Z). See also <-rfc_string, <-string and <-convert. This format is defined as CCYY-MM-DDThh:mm:ss[Z|+-hh:mm]. See the XML schema definition for details.nnnnnsN M.date.S.setOIxN M.date.S.setRIOIx?ã—NsetnOIxçSet all non-default components. This method is also used by ->initialise if arguments are provided. It uses the mktime() function which appears to have different behaviour on different systems on timestamps before the epoch at Jan. 1, 1970 UTC. On some systems it returns negative values, while on others it returns the error code -1. Note that even on systems with negative values the last second before the epoch cannot be represented. An error is returned if mktime() returns -1.nnnnnsNM.date.S.initialiseOIxNM.date.S.initialiseRIOIx?ã¬N initialisenOIxÃCreate a date object from its components. Any defaulted value defaults to the current value. Thus ?- new(D, date(0, 35, 14)). Represents 14.35h today. See ->set for details and limitations.nnnnnsNM.date.G.posix_valueOIxNM.date.G.posix_valueRIOIx7ûWN posix_valuennnOIxIXnnnsNM.date.G.convertOIxNM.date.G.convertRIOIx>ã21NconvertnOIx4Convert a date from textual representation. It uses the public domain getdate.y file converting many commonly used textual representations of date/time. Before using the getdate.y library it tries to convert the XML-Schema defined dateTime representation. See also <-string, <-rfc_string and <-xml_string.nOIxIENM.date.S.convertXnnnsNM.date.S.equalOIxNM.date.S.equalRIOIx<-ô€NequalnOIxlSucceeds if both date objects represent the same point in time. See also ->before, ->after and <-difference.nnnnnsNM.date.G.compareOI xNM.date.G.compareRIOI!x,}ÖlNcomparenOI"xCompare to date objects and return one of smaller (before), equal (same time) or larger (after). May be used by `chain ->sort'. The following example sorts a chain of file objects according to their last modification time: send(Files, sort, ?(@arg1?time, compare, @arg2?time))nnnnnsNM.date.S.afterOI#xNM.date.S.afterRIOI$x<-ôaNafternOI%x?Test if date is after argument. See also ->before and ->equal.nnnnnsNM.date.S.posix_valueOI&xNM.date.S.posix_valueRIOI'x7ûÏN posix_valuenOI(xÚCommunicate the represented time-stamp as a POSIX time stamp, i.e. the number of seconds elapsed since the epoch, Jan 1, 1970. This value is passed as a float to avoid the limited range supported by the XPCE int type.nOI)xIeNM.date.G.posix_valueXnnnsNM.date.S.beforeOI*xNM.date.S.beforeRIOI+x<-ô>NbeforenOI,x?Test if date is before argument. See also ->equal and ->after.nnnnnsNM.date.S.convertOI-xNM.date.S.convertRIOI.x,}×¹NconvertnOI/xêConversion of a textual representation of a date into a date object. These methods exploit the GNU-project get_date() library and convert various commonly used representations of a date. Unfortunately this library is undocumented ...nnnnnsNM.date.G.rfc_stringOI0xNM.date.G.rfc_stringRIOI1x>ã1›N rfc_stringnOI2x:<-string in RFC compatible format. See also <-xml_string.nnnnnsNM.date.S.currentOI3xNM.date.S.currentRIOI4x<¸|µNcurrentnOI5x.Make the date object reflect the current time.nnnnnsNM.date.G.stringOI6xNM.date.G.stringRIOI7x>ã1ˆNstringnOI8xÞNew string object representing date. This method uses the C-library function ctime(). It's format is: `Mon Sep 14 17:23:18 1992' See also <-rfc_string and <-xml_string for conversion to other popular representations.OI9xIeNM.date.G.print_nameEN$class/pce$M.pce.G.dateXnnnOI:xsThere is no way to manipulate the printed representations of a date apart from redefining this method from scratch.sNM.date.G.print_nameOI;xNM.date.G.print_nameRIOIxIENM.date.G.stringXnnnnXaCnumberOI?xx