where and how i put the lc_time_names parameter?

hi,

with mysql, we can specify the local names for days by example.
so in mysql query we set the lc_time_names =‘FR_fr’ to have the name of the days in French instead of english…
i tried to set the parameter in phpmaker, advanced settings, option “Database time zone (for SET TIME ZONE)” .
i enter in the field : lc_time_names =‘FR_fr’
but nothing appened, data (like daynname(date) still appears in english language (whereas all the other language setting are fine translated in phpmaker).
do i need a special syntaxe or double quote or other scheme to enter lc_time_names =‘FR_fr’ ?

i checked the documentation and there is not example of the correct synthaxe we need to enter in phpmaker.

best regards

SET TIME ZONE is used to set time zone, not locale. You may use Database_Connected server event (see the topic Server Events and Client Scripts in help file) to execute SET lc_time_names.

thank you my Lord, it run fine :

// Database Connected event
function Database_Connected(&$conn) {
	// Example:
	//if ($conn->info["id"] == "DB")
	//	$conn->Execute("Your SQL");
	$conn->execute("SET lc_time_names = 'fr_FR';");
}

By the way, that kind of parameter should be in the language file or region files like in the locale setting fr.json file with other regional parameter…

Hi,
I trying to get the day name in german.
My language Id is de-CH and the local setting is also correct and the languate id too.
But I am not getting the german daynumnber.
I am using the following code in a view to get the day name of a datetime field:Date_Format(f.Start, ‘%a’) AS Tag,Where to check?

thanks
mpol_ch

Did you mean you put that code as a part of WHERE clause of your Database View?

No,
It is in a view and between Select and From.
What want to reach is, is to get the day abbrevation in german, hence I am using the german language with id de-CH.
Generally it should do this with
SET lc_time_names = ‘de-CH’
But where to put this SET lc_time_names = ‘de-CH’ ?Regards
mpol_ch

You may then post the related tables schema (CREATE TABLE …) including the database view schema (CREATE VIEW …) for more discussion.

arbei wrote:

You may use > Database_Connected > server event (see the topic Server Events and Client Scripts in help file) to execute SET lc_time_names.

Thank you for the information.
I am using an “view” in phpmaker.
How should I insert the following code it in to a view?
Is that possible?$conn->execute(“SET lc_time_names = 'ch-DE;”);Thanks
mpol_ch

  1. As said you should use Datebase_Connected server event,
  2. You should use correct locale value, read MySQL Server Locale Support.