dbgrid control column data manipulation

wizard2000
wizard2000 used Ask the Experts™
on
I have a DBGrid control and this selects, obviously, data from the database. There is one column (time) which is stored in the database as epoch... is there any way to convert this to a readable date form to be displayed in the DBGrid?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004

Commented:
what is "as epoch"?

you could use the gettext/settext-event
of this tfield to convert the value as you need

Author

Commented:
epoch, seconds since 1970
Top Expert 2004

Commented:
well, in this case are two possibilities

as stated above you can use the OnGetText/OnSetText events
for calculate and displaying your value as date and vice versa for storing

or

you could use a calculated field for display,
where your calculation is then done in the onCalcFields-event of your dataset

calculation follows

meikl ;-)
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Author

Commented:
worked out a way to do it in my select statement from oracle
Top Expert 2004

Commented:
well,
if the database is able
for such calculation,
then is this the best way

you may ask at community-support
for paq this q and refund your points

glad you get it work

meikl ;-)
Commented:
PAQ'd and points refunded

modulo

Community Support Moderator
Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial