Qore SqlUtil Module Reference 1.9.3
Loading...
Searching...
No Matches
cop_trunc_date formats

Variables

const SqlUtil::DT_DAY = "D"
 Format unit: day.
const SqlUtil::DT_HOUR = "H"
 Format unit: hour.
const SqlUtil::DT_MINUTE = "m"
 Format unit: minute.
const SqlUtil::DT_MONTH = "M"
 Format unit: month.
const SqlUtil::DT_SECOND = "S"
 Format unit: hour.
const SqlUtil::DT_YEAR = "Y"

Detailed Description

These are formatting constant which can be used in cop_trunc_date() formatting argument.

Input date used in the table below: 20.4.2017 14:27:34

ConstantMeaningExample
DT_YEARTruncate date up to year1.1.2017 00:00:00
DT_MONTHTruncate date up to month1.4.2017 00:00:00
DT_DAYTruncate date up to day20.4.2017 00:00:00
DT_HOURTruncate date up to hour20.4.2017 14:00:00
DT_MINUTETruncate date up to minute20.4.2017 14:27:00
DT_SECONDTruncate date up to second20.4.2017 14:27:34
Note
Oracle: using DT_SECOND for DATE type does not make sense as the DATE resolution is up to seconds out of the box. On the other side TINESTAMP is truncated up to seconds with this operator.

Variable Documentation

◆ DT_YEAR

const SqlUtil::DT_YEAR = "Y"

Format unit: year