System/OS
2013.04.23 12:23

[mysql] 시간 관련 SQL구문..

Views 10773 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
현재 시간을 타임스템프로 출력하는 구문
select now();
select unix_timestamp();

현재 시간을 년-월-일 시간으로 출력하는 구문
select sysdate();

현재 시간을 년월일시.. 모두 붙여서 출력하는 구문
select now()+0;


예를 들어..

select substring(now(), 0, 4);
이 구문을 쓰면 타임스템프의 앞부분 4자리를 가져오지만..

select substring(now()+0, 0, 4);
이 구문을 쓰면 4자리 현재 년도를 가져오게 된다.

?

List of Articles
No. Category Subject Author Date Views
58 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4478
57 System/OS [linux] 쉘스크립트 expr hooni 2014.03.11 15618
56 System/OS [linux] awk 명령어 hooni 2014.03.11 4955
55 System/OS [linux] split 명령어 hooni 2014.03.11 4305
54 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7546
53 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4286
52 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5117
51 System/OS [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." hooni 2014.04.05 4838
50 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 4616
49 System/OS [linux] yum 업데이트 시 커널 제외하기 hooni 2014.09.11 1256
48 System/OS SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함) file hooni 2014.09.11 5664
47 System/OS [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) hooni 2014.11.27 1564
46 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 993
45 System/OS iptime 공유기 해킹 기술문서 4 file hooni 2015.01.01 1941
44 System/OS [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories) hooni 2015.01.02 1549
43 System/OS CentOS 에서 Cacti 설치하기 hooni 2015.01.02 1762
Board Pagination Prev 1 ... 8 9 10 11 12 13 Next
/ 13