Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Time for create account


YePix

Recommended Posts

Not sure where you want to display this but you could either create a new function inside the general.php or manipulate the tep_datetime_short function.

A new function could look like this
 

  function tep_time_long($raw_time) {
    if ( ($raw_time == '0000-00-00 00:00:00') || ($raw_time == '') ) return false;

    $hour = (int)substr($raw_time, 11, 2);
    $minute = (int)substr($raw_time, 14, 2);
    $second = (int)substr($raw_time, 17, 2);

    return strftime(TIME_LONG, mktime($hour, $minute, $second));
  }

Add a new definition inside the language file (english.php or in your case german.php)

define('TIME_LONG', '%H:%M:%S');

Then use tep_time_long(....) to output the time.
Or if you don't want the seconds just add the following into your language file

define('TIME_SHORT', '%H:%M');

Or you could manipulate the existing tep_datetime_short function by replacing DATE_TIME_FORMAT with the new added TIME_SHORT or TIME_LONG and then use tep_datetime_short (...) to output the time.
Of course you will need to query the info from the database (customers_info_date_account_created)
This is from the admin/customers.php file

$info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");

Maybe there is even an easier way, a PHP way to do it but I am not aware of one at the moment.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...