Using Drupal 8, I can change the date format, and adapt it to the country.
How can I do the same in a Drupal 7 site, where I do not want to create a node.tpl.php file in my theme since I need fast work?
You can use template_preprocess_node
to alter submitted
variable. Here is the sample code.
function awesome_preprocess_node(&$variables) {
$node = $variables['node'];
$date = format_date($node->created, 'custom', 'm-d-Y - H:i');
$variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $date));
}
The most important line there is $date = format_date($node->created, 'custom', 'm-d-Y - H:i');
. Change the format (m-d-Y - H:i
) to any format you want.
See this page about PHP date format.
template.php
and that why I provided this answer. Anyway glad you solved your problem in a less complicated manner.