SAK }‘ŠÙ
MySQL •Ò16 - “ú•tŠÖ”AƒVƒXƒeƒ€“ú•tAØŽÌA“ú•t·A“ú•t‰ÁŽZA‘Ž®
¡ƒVƒXƒeƒ€“ú•tAƒVƒXƒeƒ€ŽžŠÔ Ecurrent_timestamp() ŠÖ”‚ÍAƒVƒXƒeƒ€“ú•t(ƒT[ƒo“ú•t) ‚ð•Ô‚·B select current_date; +--------------+ | current_date | +--------------+ | 2003-05-29 | +--------------+ select current_time; +--------------+ | current_time | +--------------+ | 20:48:35 | +--------------+ select current_timestamp; +---------------------+ | current_timestamp | +---------------------+ | 2003-05-29 20:48:47 | +---------------------+ select now(); +---------------------+ | now() | +---------------------+ | 2003-05-29 20:49:01 | +---------------------+ select date_format(now(), '%y.%m.%d'); +--------------------------------+ | date_format(now(), '%y.%m.%d') | +--------------------------------+ | 03.05.29 | +--------------------------------+ select date_format(now(), '%Y.%m.%d'); +--------------------------------+ | date_format(now(), '%Y.%m.%d') | +--------------------------------+ | 2003.05.29 | +--------------------------------+ ¡“ú•tØ‚èŽÌ‚Ä Etruncate ‚ł̓Gƒ‰[‚É‚È‚é‚Ì‚ÅAŽ©M‚Í‚È‚¢‚ªŽŸ‚̂悤‚ÈŠ´‚¶‚Å‘ã‘Ö‚¦‚Å ‚«‚È‚¢‚±‚Æ‚à‚È‚¢‚©‚ÈB(^^; select cast(substring(now(), 1, 10) as date); +---------------------------------------+ | cast(substring(now(), 1, 10) as date) | +---------------------------------------+ | 2003-05-29 | +---------------------------------------+ ¡“ú•t‚Ì· (“ú•tŠÔŠuA“ú•t”͈Í) Eto_days() ‚ð‚¤‚Ü‚—˜—p‚·‚éB (“ú•tŒvŽZA“ú”ŒvŽZAƒJƒŒƒ“ƒ_[ŒvŽZ) select to_days(now()) - to_days('2003-05-27 00:00:00'); +-------------------------------------------------+ | to_days(now()) - to_days('2003-05-27 00:00:00') | +-------------------------------------------------+ | 2 | +-------------------------------------------------+ ¡“ú•t‚̉ÁŽZ Edate_add ‚ðŽg—p‚·‚éB (“ú•tŒvŽZA“ú”ŒvŽZAƒJƒŒƒ“ƒ_[ŒvŽZ) select date_add(now(), interval 3 day); +---------------------------------+ | date_add(now(), interval 3 day) | +---------------------------------+ | 2003-06-01 21:12:06 | +---------------------------------+ ¡ŽŸ‚Ì—j“ú E‚‚¤[A‚í‚©‚ñ‚È‚¢B(^^; ¡ŒŽ––“ú E‚‚¤[A‚í‚©‚ñ‚È‚¢B(^^; ¡“ú•tŒ^‚Ö•ÏŠ·(‘Ž®•ÏŠ·A“ú•t•ÏŠ·) E‚ ‚Ü‚èˆÓŽ¯‚·‚é•K—v‚ª‚È‚¢‚©‚à‚µ‚ê‚È‚¢B select concat(now(), ' test'); +--------------------------+ | concat(now(), ' test') | +--------------------------+ | 2003-05-29 21:25:43 test | +--------------------------+ ¡Œ^•ÏŠ· E‚ ‚Ü‚èˆÓŽ¯‚·‚é•K—v‚ª‚È‚¢‚©‚à‚µ‚ê‚È‚¢B ¡MySQL •ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿