IoDate *IoDate_rawClone(IoDate *proto) { IoObject *self = IoObject_rawClonePrimitive(proto); IoObject_setDataPointer_(self, Date_new()); Date_copy_(DATA(self), DATA(proto)); return self; }
double Date_secondsSinceNow(const Date *self) { Date *now = Date_new(); double s = Date_secondsSince_(now, self); Date_free(now); return s; }
IoDate *IoDate_proto(void *state) { IoMethodTable methodTable[] = { {"asSerialization", IoDate_asSerialization}, {"fromSerialization", IoDate_fromSerialization}, {"now", IoDate_now}, {"clock", IoDate_clock}, {"copy", IoDate_copy}, {"cpuSecondsToRun", IoDate_cpuSecondsToRun}, {"year", IoDate_year}, {"setYear", IoDate_setYear}, {"month", IoDate_month}, {"setMonth", IoDate_setMonth}, {"day", IoDate_day}, {"setDay", IoDate_setDay}, {"hour", IoDate_hour}, {"setHour", IoDate_setHour}, {"minute", IoDate_minute}, {"setMinute", IoDate_setMinute}, {"second", IoDate_second}, {"setSecond", IoDate_setSecond}, {"isDaylightSavingsTime", IoDate_isDaylightSavingsTime}, {"zone", IoDate_zone}, {"isDST", IoDate_isDST}, {"setGmtOffset", IoDate_setGmtOffset}, {"gmtOffset", IoDate_gmtOffset}, {"gmtOffsetSeconds", IoDate_gmtOffsetSeconds}, {"convertToUTC", IoDate_convertToUTC}, {"convertToZone", IoDate_convertToZone}, {"convertToLocal", IoDate_convertToLocal}, {"setToUTC", IoDate_setToUTC}, {"isValidTime", IoDate_isValidTime}, {"secondsSince", IoDate_secondsSince_}, {"secondsSinceNow", IoDate_secondsSinceNow}, {"isPast", IoDate_isPast}, //{"dateAfterSeconds", IoDate_dateAfterSeconds_}, {"asString", IoDate_asString}, {"asNumber", IoDate_asNumber}, {"fromNumber", IoDate_fromNumber}, {"fromString", IoDate_fromString}, {"print", IoDate_printDate}, {"+", IoDate_add}, {"-", IoDate_subtract}, {"+=", IoDate_addInPlace}, {"-=", IoDate_subtractInPlace}, {NULL, NULL}, }; IoObject *self = IoObject_new(state); IoObject_tag_(self, IoDate_newTag(state)); IoObject_setDataPointer_(self, Date_new()); /*doc Date format Returns the format string for the receiver. The default is "%Y-%m-%d %H:%M:%S %Z". */ IoObject_setSlot_to_(self, IOSYMBOL("format"), IOSYMBOL("%Y-%m-%d %H:%M:%S %Z")); IoState_registerProtoWithFunc_((IoState *)state, self, IoDate_proto); IoObject_addMethodTable_(self, methodTable); return self; }