Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

CUBRID DATETIME Data Type


The CUBRID DATETIME data type differs a bit from the MySQL DATETIME field.

There are several acceptable formats, such as YYYY-MM-DD hh:mi:ss.fff or mm/dd/yyyy hh:mi:ss.fff. For more information check the DATETIME manual page.

Here is the same command (SELECT SYSDATETIME) in CSQL and CUBRID Manager:

sysdatetime.png sysdatetime_cubrid_manager.png

Note: As you can see, the values are not displayed using the same format

Even though CUBRID supports 4 formats, the standard format used by CUBRID is hh:mm:ss.fff AM/PM mm/dd/yyyy (Example: 04:33:51.596 PM 10/29/2012). This is the format used when applying String functions such as SUBSTR on the value. Below you can see an example on how the month or year can be obtained using the SUBSTR function.

select_month.png

select_year.png

Of course, there are other ways to do this, but the point of this tutorial is to help you understand how CUBRID stores the DATETIME data type.

Take note that the same problem occurs for the DATE data type, where csql returns 10/29/2012 (which is the default CUBRID DATE format), while CUBRID Manager returns 2012-10-29.

comments powered by Disqus
Page info
viewed 2361 times
translations en
Author
posted 2 years ago by
CUBRID
Contributors
updated 2 years ago by
View revisions
Share this article