Convert DB field using math functions

QuestionsConvert DB field using math functions
Joey Newsom asked 10 years ago

I have a DB field called 'time' which is an integer field containing seconds… (minutes and seconds were converted to seconds for easier sorting of 'time' field)

In my GRID, I need to convert the time back to minutes and seconds in the format MM:SS.

Any suggestions?

Joey

1 Answers
Abu Ghufran answered 10 years ago

You can use mysql date_format function in sql, and get desired format in grid.
Even if you want to do this conversion at application level, you can refer on_data_display event handler (demos/editing/custom-events.php)

Your Answer

11 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?