0

Googling the only thing I've managed to find is: https://www.drupal.org/node/2800563

What can I do to translate 'ago' or omit it from printing?

1 Answer 1

0

can't we do like this?

  //Get today's date.
  $today = getdate();
  //Calculate the date "1 week ago".
  $start_time = mktime(0, 0, 0,$today['mon'],($today['mday'] - 7), $today['year']);

Also, you can change those zeroes to make 'n' hours/ minutes/ seconds ago.

1
  • I was asking about how to translate the string that follows the time format, not how to convert dates. I apologize if my question was not clear enough for you.
    – Jed_BH
    Commented Mar 24, 2017 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.