However, the above method not only has the inconvenience of having to designate a specific time based on the time zone every time, but also has a problem in that the amount of data transmission increases linearly when the time zone value is included for a large amount of data.
Therefore, Machbase supports the method of specifying the time zone property for the session in which the client and server are connected.
The following is a step-by-step explanation of the time zone operation provided by Machbase.
The server operates based on the default time zone provided by the operating system in which the server is installed. In other words, if no setting is made, Machbase reads and uses the time zone in which the OS operates.
If the client program connects to the server without setting the time zone, the client's time zone is set to the server's time zone. That is, if the TIMEZONE set in the server is KST, it means that the client also operates in KST.
If the time zone is explicitly set in the client program, the corresponding session of the server operates in the time zone designated by the client. That is, even if the TIMEZONE set in the server is KST, if the client sets the time zone as EDT when connecting, the session operates as EDT.
Timezone Format in Machbase
Machbase provides only one format consisting of 5 characters to increase ease of use and remove complexity.
That is, the first character is a + or - sign indicating the sign of time, and the following two characters have a value between 00 and 23. And, it is assumed that the last two characters have a time from 00 to 59.
The following shows the format of TIMEZONE supported by Machbase.
When machsql is started, you can set the time zone to operate through the following options.
You can check the currently set time zone through the SHOW TIMEZONE command.
Mach> show timezone;
Timezone : +0900
When running machloader, you can set the time zone to operate through the following options.
It connects to the designated time zone and time calculation operates based on the corresponding time zone.
TIMEZONE has been added to the connection string, and the time zone for the session can be specified.
If TIMEZONE is not specified in the connection string, it operates based on the time zone of the server.