일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- PostgreSQL
- math
- GIT
- SQL
- Google Spreadsheet
- Apache
- Google Excel
- Mac
- django
- Tkinter
- string
- c#
- numpy
- PySpark
- hive
- list
- array
- matplotlib
- google apps script
- Github
- Kotlin
- Excel
- 파이썬
- Redshift
- PANDAS
- dataframe
- Python
- Java
- gas
- Today
- Total
목록from_unixtime (2)
달나라 노트
current_date를 사용하면 현재 날짜를 출력할 수 있습니다. select current_date, date_format(current_date, 'yyyyMMdd'), unix_timestamp(), from_unixtime(unix_timestamp()), date_format(from_unixtime(unix_timestamp()), 'yyyyMMdd') ; -- Result 2021-08-24 20210824 위처럼 current_date는 오늘 날짜를 반환해줍니다. date_format 함수와 같이 사용해서 날짜 형식도 바꿀 수 있습니다. select date_add(current_date, -1) ; -- Result 2021-08-23 date_add 함수와 동시에 사용할 수도 있습니다..
unix_timestamp()의 사용법은 아래와 같습니다. unix_timestamp(날짜를 나타내는 텍스트, 날짜의 형식) 예시를 한번 봐봅시다. select unix_timestamp('2020-11-10', 'yyyy-MM-dd'); 결과 : 1604934000 위 식을 보면 날짜를 나타내는 텍스트는 2020-11-10입니다. 그리고 이 텍스트가 yyyy-MM-dd라는 형식을 가지고 있다고 알려주면, 2020-11-10이라는 날짜를 unix timestamp로 변환해서 반환해주죠. select unix_timestamp('20201110', 'yyyyMMdd'); 결과 : 1604934000 만약 위처럼 주어지는 날짜 텍스트의 형식이 yyyy-MM-dd에서 yyyyMMdd로 바뀐다면, 날짜 형식도 ..