일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- PySpark
- Google Spreadsheet
- Java
- Redshift
- Google Excel
- math
- GIT
- Apache
- Excel
- Mac
- array
- numpy
- matplotlib
- Kotlin
- Tkinter
- gas
- SQL
- PANDAS
- Github
- PostgreSQL
- google apps script
- c#
- Python
- hive
- django
- 파이썬
- dataframe
- list
- string
- Today
- Total
목록google apps script (65)
달나라 노트

GAS에서는 날짜 객체에서 특정 요소(e.g. 년, 월, 일, 시간, 분, 초)들을 원하는대로 변경할 수 있는 함수입니다. 예를들어 2022-11-20 20:13:56 라는 날짜 객체가 있으면 여기서 년도를 2025년으로 변경한다거나 시간을 19시로 바꾼다거나 등의 기능인 것이죠. Syntax DateTime.setFullYear(number) DateTime.setMonth(number) DateTime.setDate(number) DateTime.setHours(number) DateTime.setMinutes(number) DateTime.setSeconds(number) 사용법은 위와 같습니다. 날짜 객체에 위 method들을 적용시켜 원하는 숫자를 전달해주면 됩니다. 하나씩 알아봅시다. func..

getDay() method는 특정 날짜의 요일을 요일 번호로 return해줍니다. Syntax Date.getDay() 사용법은 위와 같습니다. Date 객체에 getDay() method를 적용하면 됩니다. function myFunction() { var today_dt = new Date(); var today_weekday = today_dt.getDay(); Logger.log(today_dt); Logger.log(today_weekday); } - var today_dt = new Date(); new Date()로 현재 날짜와 시간을 얻어옵니다. - var today_weekday = today_dt.getDay(); 오늘 날짜/시간을 담고있는 today_dt 변수에 getDay() me..

GAS(Google Apps Script)에서 날짜나 시간 서식을 원하는대로 변경하려면 Utilities.formatDate() method를 사용하면 됩니다. Syntax Utilities.formatDate(date_object, time_zone, format) 사용법은 위와 같습니다. date_object = date type 또는 date time type의 날짜/시간 데이터를 넣어줍니다. time_zone = 날짜/시간을 다룰 때 기준이 되는 시간대를 의미합니다. (주로 GMT, UTC를 사용합니다.) format = 얻기를 원하는 날짜/시간 format입니다. function myFunction() { var today_dt = Utilities.formatDate(new Date(), 'U..
GAS에서는 객체라는 것이 있습니다. 마찬가지로 여러 데이터를 하나로 묶어서 다루는 방식이며 python의 dictionary와 매우 유사하다고 생각하면 편합니다. function myFunction() { var animal = { 'name': 'cat', 'color': 'white', 'age': 3 }; console.log(animal['name']); console.log(animal['color']); console.log(animal['age']); } -- Result cat white 3 위 코드는 animal이라는 변수에 객체를 할당한 코드입니다. var animal = { 'name': 'cat', 'color': 'white', 'age': 3 }; 객체 선언 부분을 봅시다. 일..