Showing "Last Updated" Time Stamp on Price List

We created a price list page for a client with a volatile and capricious product -- fresh wild fish. With frequent changes in the pricing and availability, and the customers (restaurants) constantly visited the site to see the latest fish landings.

The client wanted to display the time and date of the latest change in data displayed in a view, to help its customers get oriented quickly. Drupal does not provide that capability out of the box, but it's easy to implement with a shell script using SQL on the host, plus a small PHP snippet to call the script inside a Drupal page.

The snippet looks like this (don't forget to enable PHP as the content type):

<?php
Last updated: <?php $output = shell_exec("bash /usr/local/bin/get-latest-mod-time"); echo $output; ?>

The shell script get-latest-mod-time (running on the Cloud host) looks like this:

date +"%a %b %d %T" -d @`(
cat <<EOF
SELECT node.changed
FROM  content_type_fish , node
WHERE node.nid = content_type_fish.nid;
EOF
) | mysql --raw --silent -u user -ppassword sea2table_d6 | sort -r | sed 1q | \
awk '{print $0 - 14400}'`

The result can be seen on this page on the client's site.

Note: The "-14400" at the end of the shell script is needed to adjust for the time zone difference between the host computer location and the client company's location.

Summary: 
The client wanted to display the time and date of the latest change, to help its customers get oriented quickly. Drupal does not provide that capability out of the box, but it's easy to implement with a shell script using SQL on the host, plus a small PHP snippet to call the script inside a Drupal page.