Login     Sign up
Date Turkish format
Olcay Tasdemir (@artvinli)
Join date: Oct 20th 2010
Community posts: 5
View Profile
Send Message

My websitesi dashboard date:
17 October 2010

This date turkish format:
17 Ekim 2010

How may make this format?

174 months ago
Olcay Tasdemir (@artvinli)
Join date: Oct 20th 2010
Community posts: 5
View Profile
Send Message

[code]setlocale(LC_MESSAGES, 'tr_TR.utf8');
echo strftime('%e-%B-%Y %H:%M');[/code]

This command makes the necessary changes, but I do not know what the file should be put.

I'm sorry for bad english

174 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

it is setlocale(LC_TIME,"tr_TR")

you can set it in my/config.php

LC_MESSAGES is for when you get an system error

then in includes/libs/common.inc.php

function get_date

change

[code]
if ($type == 'date'){
return gmdate($settings['date_format'],$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current)) {
return $settings['date_today'].', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-3600*24) ) ) {
return $settings['date_yesterday'].', '.gmdate($settings['time_format'],$timeline);
}
return gmdate($settings['date_format'].', '.$settings['time_format'],$timeline);
}[/code]

into

[code]
if ($type == == 'date'){
return gmstrftime('%e-%B-%Y',$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current)) {
return $settings['date_today'].', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-3600*24) ) ) {
return $settings['date_yesterday'].', '.gmdate($settings['time_format'],$timeline);
}
return gmstrftime('%e-%B-%Y %H:%M',$timeline);
}
[/code]

this works only if you have only one language, in this case Turkish

if you have more than one language on your site, the names of the months will be displayed only in Turkish.

174 months ago
Olcay Tasdemir (@artvinli)
Join date: Oct 20th 2010
Community posts: 5
View Profile
Send Message

Thank you sir but error messages:

Parse error: syntax error, unexpected T_IS_EQUAL in /home/tasdntr1/domains/tasdemir.gen.tr/public_html/includes/libs/common.inc.php on line 285

kod final:
[code]function get_date($timeline, $type = 'time') {
GLOBAL $settings, $client;
$timeline = $timeline + $client['timezone']3600;
$current = time() + $client['timezone']
3600;
$it_s = intval($current - $timeline);
$it_m = intval($it_s/60);
$it_h = intval($it_m/60);
$it_d = intval($it_h/24);
$it_y = intval($it_d/365);
if ($type == == 'date'){
return gmstrftime('%e-%B-%Y',$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current)) {
return $settings['date_today'].', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-3600*24) ) ) {
return $settings['date_yesterday'].', '.gmdate($settings['time_format'],$timeline);
}
return gmstrftime('%e-%B-%Y %H:%M',$timeline);
}

}
[/code]

[code]line 285: if ($type == == 'date'){[/code]

174 months ago
Olcay Tasdemir (@artvinli)
Join date: Oct 20th 2010
Community posts: 5
View Profile
Send Message

ok ok complate :)

new codes: [code]
function get_date($timeline, $type = 'time') {
GLOBAL $settings, $client;
$timeline = $timeline + $client['timezone']3600;
$current = time() + $client['timezone']
3600;
$it_s = intval($current - $timeline);
$it_m = intval($it_s/60);
$it_h = intval($it_m/60);
$it_d = intval($it_h/24);
$it_y = intval($it_d/365);
if ($type == 'date'){
return gmstrftime('%e %B %Y',$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current)) {
return $settings['date_today'].', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-3600*24) ) ) {
return $settings['date_yesterday'].', '.gmdate($settings['time_format'],$timeline);
}
return gmstrftime('%e %B %Y, %H:%M',$timeline);
}

}
[/code]

Finaly: 17 Ekim 2010, 11:36

Thank you

174 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

ok was one == too much.

174 months ago