chilliroom wrote:
>
quote:
format it via the db is probably the cheapest.
> I am still unsure how to catch the date for each row
before the cfgrd grabs it.
what db? does it have this functionality? for sql server
something like should
work (but again watch for overflow):
SELECT
dateAdd(second,yourUnixEpochOffsetDataColumn,'1-jan-1970') as
aDate,....
FROM yourTable
> How can I extract this value to then feed into
"yourUnixEpochOffsetData".
if your db can't handle this, here's one way using cf (but
the db is cheaper).
do your normal cfquery then:
- convert the unix epoch offsets to datetimes:
unixEpoch=createDate(1970,1,1);
newDates=arrayNew(1);
for (i=1; i LTE yourRegularcfQuery.recordCount;i=i+1) {
newDates
=dateAdd("s",yourRegularcfQuery.yourUnixEpochOffsetDataColumn,unixEpoch);
}
depending on your needs, you might also want to dateFormat
the results of the
dataAdd:
newDates
=dateFormat(dateAdd("s",yourRegularcfQuery.yourUnixEpochOffsetDataColumn,unixEpoch));
- add a column to your cfquery & fill with those
converted dates,
queryAddColumn(yourRegularcfQuery,"aDate","date",newDates);