From bug-octave-request at bevo dot che dot wisc dot edu Thu Nov 16 11:25:09 2000 Subject: date manipulation From: "John W. Eaton" To: Paul Kienzle Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 16 Nov 2000 11:24:59 -0600 I applied this patch. Thanks, jwe On 8-Nov-2000, Paul Kienzle wrote: | >From the mktime() manual page: | | The mktime() function converts a broken-down time structure, | expressed as local time, to calendar time representation. | | | | If structure members are outside their legal interval, they | will be normalized (so that, e.g., 40 October is changed into | 9 November). | | You might want this to add one day, one week or one month to the current | day without worrying about whether this puts you into the next month or | year. However, Octave explicitly limits the range on the fields of the | time structure so that you cannot make use of this behaviour. The attached | patch against 2.1.31 removes the range limits from liboctave/oct-time.cc. | | | *** liboctave/oct-time.cc 2000/10/05 09:33:32 1.1 | --- liboctave/oct-time.cc 2000/11/07 10:19:03 | *************** octave_time::stamp (void) | *** 128,133 **** | --- 128,134 ---- | #endif | } | | + #if 0 | #define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \ | octave_base_tm& \ | octave_base_tm::f (int v) \ | *************** octave_time::stamp (void) | *** 140,145 **** | --- 141,156 ---- | \ | return *this; \ | } | + #else | + #define DEFINE_SET_INT_FIELD_FCN(f, lo, hi) \ | + octave_base_tm& \ | + octave_base_tm::f (int v) \ | + { \ | + tm_ ## f = v; \ | + \ | + return *this; \ | + } | + #endif | | DEFINE_SET_INT_FIELD_FCN (usec, 0, 1000000) | DEFINE_SET_INT_FIELD_FCN (sec, 0, 61) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------