SQL parameter DATE_FORMAT pre funkcie na prácu s časom
SQL -> Funkcie -> Funkcie pre prácu s dátumom a časom -> SQL parameter DATE_FORMAT pre funkcie na prácu s časom
Nastavenie argumentu interval
Skupina | Formát | Definícia |
---|---|---|
Roky | YYYY | Four digit year (most commonly used) |
Roky | YYY | Day of the week fully spelled out (e.g. TUESDAY) |
Roky | YY | Day of the week fully spelled out (e.g. TUESDAY) |
Roky | Y | Day of the week fully spelled out (e.g. TUESDAY) |
Roky | SYYYY | Signed year. BC is negative, and AD is positive |
Roky | IYYY | *ISO four digit year |
Roky | IYY | *ISO three digit year |
Roky | IY | *ISO two digit year |
Roky | I | *ISO one digit year |
Roky | RR | Last two digits of year relative to current date |
Roky | YEAR | Year spelled out (e.g. TWO THOUSAND NINE) |
Roky | CC, SCC | Storočie |
Mesiace | MM | Number of Mesiace since the new year (e.g. 2 = February, most commonly used) |
Mesiace | MON | Three letter abbreviation for month (e.g. AUG = AUGUST) |
Mesiace | MONTH | Month spelled out fully (e.g. JANUARY) |
Mesiace | RM | Roman numeral version of MM (e.g. IV = April) |
Mesiace | Q | Current quarter, always 1-4 |
Dni | DDD | Number of Dni since Jan 1 in the current year |
Dni | DD | Number of Dni since the beginning of the month (most commonly used) |
Dni | D | Number of Dni since the beginning of the week (e.g. 2 = Monday) |
Dni | DAY | Day of the week fully spelled out (e.g. TUESDAY) |
Dni | DY | Day of the week abbreviated to three letters (e.g. TUE) |
Dni | J | Julian Dni since December 31, 4713, B.C. |
Týždne | WW | The current week number in the year (e.g. 3 = third week in January) |
Týždne | IW | *Week in year based on ISO standard |
Týždne | W | Number of current week in the month |
Hodiny | HH | Number of Hodiny, always 1-12(most commonly used) |
Hodiny | HH12 | More formal version of HH |
Hodiny | HH24 | 24 hour time, always 0-23 |
Minúty | MI | Number of Minúty past the current hour, always 0-59 |
Sekundy | HH | Sekundy past the current minute, always 0-59 (most commonly used) |
Sekundy | SSSS | Number of Sekundy since midnight, always 0-86399 |
Qualifiers | A.M. or P.M. | Displays, or converts A.M. or P.M. notations. In TO_CHAR, both A.M. and P.M. provide equivalent functions. In TO_DATE, each represents a time of day (e.g. before or after noon) |
Qualifiers | AM or PM | Same as above, only without the periods (i.e. "AM" vs "A.M.") |
Qualifiers | B.C. or A.D. | In TO_CHAR, both result in displaying the century qualifier. In TO_DATE, either one will result in conversion to the appropriate epoch. |
Qualifiers | BC or AD | Same as above, only without the periods (i.e. "BC" vs "B.C.") |
Punctionation | .,:-/ | All five of these characters are treated as punctionation and either displayed (TO_CHAR) or ignored (TO_DATE). |
*The ISO values refer to ISO 8601, which uses different (and very specific) rules for determining which year to represent based on a given date. Please see the actual standard for the official rules.
Parameter interval používajú funkcie
TO_CHAR(date)
TRUNC(date)