본문 바로가기

[DB]DataBase/[SQL]

[SQL] CONVERT_TZ()

728x90
반응형

CONVERT_TZ() 함수

In MySQL the CONVERT_TZ() returns a resulting value after converting a datetime value from a time zone specified as the second argument to the time zone specified as the third argument. This function returns NULL when the arguments are invalid.

 

CONVERT_TZ(dt, from_tz, to_tz)

syntax diagram

 

pictorial presentation

 

 

예시

SELECT CONVERT_TZ('2023-07-14 08:00:00', '+09:00', '+00:00');

 

SELECT CONVERT_TZ('2023-07-14 08:00:00', '+00:00', '+09:00');

 


Reference

반응형

'[DB]DataBase > [SQL]' 카테고리의 다른 글