Page 1 of 1
fmt and date ranges
Posted: Thu Aug 16, 2001 11:04 am
by sabety
I am using an unsigned integer field (like 19661012) for dates due to records in my system prior to 1970. For display I want to convert this date format codes with fmt. It does not seem to work with values prior to 1970. Any other options than manually coding this?
thanks
fmt and date ranges
Posted: Thu Aug 16, 2001 11:53 am
by Kai
If you're converting your value to a time_t (Texis date) and using strftime() codes (<fmt "%at" ...>), then you're basically limited to 1970+ because of time_t and platform strftime() limitations. The other options are completely manually printing the date; or grafting your month and day onto a leap year like 2000, printing the day/month with <fmt "%at">, and printing your year with <fmt "%d">:
<strfmt "2000-%02d-%02d" $mymonth $myday>
<fmt "%at%d" "%b %d, " $ret $myyear>
where $mymonth, $myday, $myyear are the integer month/day/year.