where and how i put the lc_time_names parameter?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
amiens80
User
Posts: 450

where and how i put the lc_time_names parameter?

Post by amiens80 »

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

arbei
User
Posts: 9383

Post by arbei »

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.

amiens80
User
Posts: 450

Post by amiens80 »

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....


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

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


mobhar
User
Posts: 11725

Post by mobhar »

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


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

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


mobhar
User
Posts: 11725

Post by mobhar »

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


arbei
User
Posts: 9383

Post by arbei »

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.


mpol_ch
User
Posts: 877
Location: Switzerland

Post by mpol_ch »

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


arbei
User
Posts: 9383

Post by arbei »

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

Post Reply