-1
The data stored in the Database has to be in a format that stores the necessary information without ambiguity, but does not have to have no relationship at all how your application presents this data to the user.
In that case, the collate
just tells the database what rules it will use for sorting operations - that’s order by
. The format that it will store the data internally should not matter - depending on the driver and the programming language can do different, but in a high-level language the driver will deliver the text as Unicode anyway.
As for dates, this format is not "English" - but an ISO format for storing time-Tamps (date and time), which has the advantage of allowing comparison of dates and times character by character from left to right, as if it were a comparison of normal strings.
Your database driver will give you dates and time-Caps as a date or datetime object in the programming language you are using, and then you use the language features to format those dates and times in the strings you want to display in the interface --
If you are using a relatively low-level language, where dates and times come as strings, the recommendation is to use some auxiliary library that has these date conversion services for you (in C for example, there are the functions stftime
and strptime
standard library).
locale
Now yes, in the language of your application (not in the database), there is a configuration called locale
, integrating with location databases for specific countries of the operating system.
Locale yes can be configured to format dates in country and language-specific formats, as well as rules for the character indicating decimal point in numbers, sort rules (in the application, not in the database). In general it is medium to difficult to program correctly using locale, depending on your language, but you can use specific functionalities according to your needs.
Quick response: collate defines character encoding and does not interfere in any way with date formatting.
– Woss
But when I query I will have to cast the English format?
– user148827