I am running a MySQL database via PERL and the DBI.
I need to incorporate a number of time and date functions such as 'the time and date a record was last updated' and 'the length of time left before bids close'.
The updated time is easy as it will be the current time, at the time of writing the record. The time remaining will be more dificult as it requires some calculation.
My problem is, not how to do it but which method to use.
The MySQL Datetime field is a convenient way of displaying the data but doesn't seen very calculation friendly whereas the Epoche seconds method is easier to calculate with but needs some formatting to display it correctly.
I am drawn towards the Epoche seconds method but would welcome any advice you may like to offer.
Keith
I need to incorporate a number of time and date functions such as 'the time and date a record was last updated' and 'the length of time left before bids close'.
The updated time is easy as it will be the current time, at the time of writing the record. The time remaining will be more dificult as it requires some calculation.
My problem is, not how to do it but which method to use.
The MySQL Datetime field is a convenient way of displaying the data but doesn't seen very calculation friendly whereas the Epoche seconds method is easier to calculate with but needs some formatting to display it correctly.
I am drawn towards the Epoche seconds method but would welcome any advice you may like to offer.
Keith