You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Building and Deployment](#building-and-deployment)
@@ -409,6 +411,127 @@ WHERE CustomerID IN (${customerData.CustomerID})
409
411
4.**Performance**: Variables are executed once and cached for the entire export
410
412
5.**Debug Mode**: Enable with `DEBUG_VARIABLES=true` for detailed variable substitution
411
413
414
+
## 🕒 Automatic DateTime Variables
415
+
416
+
SQL2Excel provides built-in datetime variables that are automatically resolved to current time values. These variables can be used in queries, file names, and any text content.
417
+
418
+
### Basic DateTime Functions
419
+
420
+
| Variable | Description | Example Output |
421
+
|----------|-------------|----------------|
422
+
|`${CURRENT_TIMESTAMP}`| Current UTC timestamp |`2024-10-05 15:30:45`|
423
+
|`${NOW}`| Current UTC timestamp |`2024-10-05 15:30:45`|
424
+
|`${CURRENT_DATE}`| Current UTC date |`2024-10-05`|
425
+
|`${CURRENT_TIME}`| Current UTC time |`15:30:45`|
426
+
|`${GETDATE}`| SQL Server format |`2024-10-05 15:30:45`|
427
+
428
+
### Korean Time Zone Functions
429
+
430
+
| Variable | Description | Example Output |
431
+
|----------|-------------|----------------|
432
+
|`${KST_NOW}`| Korean Standard Time |`2024-10-06 00:30:45`|
433
+
|`${KST_DATE}`| Korean date |`2024-10-06`|
434
+
|`${KST_TIME}`| Korean time |`00:30:45`|
435
+
|`${KST_DATETIME}`| Korean datetime |`2024-10-06 00:30:45`|
436
+
437
+
### Korean Localized Formats
438
+
439
+
| Variable | Description | Example Output |
440
+
|----------|-------------|----------------|
441
+
|`${KOREAN_DATE}`| Korean date format |`2024년 10월 6일`|
442
+
|`${KOREAN_DATETIME}`| Korean datetime format |`2024년 10월 6일 00:30:45`|
443
+
|`${KOREAN_DATE_SHORT}`| Short Korean date |`2024. 10. 06.`|
444
+
|`${WEEKDAY_KR}`| Korean weekday |`일요일`|
445
+
|`${MONTH_KR}`| Korean month |`10월`|
446
+
|`${YEAR_KR}`| Korean year |`2024년`|
447
+
448
+
### Formatted Date/Time Functions
449
+
450
+
| Variable | Description | Example Output |
451
+
|----------|-------------|----------------|
452
+
|`${DATE_YYYYMMDD}`| Compact date format |`20241006`|
453
+
|`${DATE_YYYY_MM_DD}`| Hyphenated date (KST) |`2024-10-06`|
"query": "SELECT '${reportTitle}' as 리포트제목, '${CURRENT_TIMESTAMP}' as 현재시각_UTC, '${NOW}' as 현재시각_NOW, '${CURRENT_DATE}' as 현재날짜, '${CURRENT_TIME}' as 현재시간, '${GETDATE}' as SQL서버형식"
16
+
},
17
+
{
18
+
"name": "한국시간대",
19
+
"use": true,
20
+
"query": "SELECT '${KST_NOW}' as 한국현재시각, '${KST_DATE}' as 한국현재날짜, '${KST_TIME}' as 한국현재시간, '${KST_DATETIME}' as 한국날짜시간, '${KST_ISO_TIMESTAMP}' as 한국ISO형식"
21
+
},
22
+
{
23
+
"name": "한국식날짜형식",
24
+
"use": true,
25
+
"query": "SELECT '${KOREAN_DATE}' as 한국식날짜, '${KOREAN_DATETIME}' as 한국식날짜시간, '${KOREAN_DATE_SHORT}' as 한국식날짜짧은형식, '${WEEKDAY_KR}' as 한국어요일, '${MONTH_KR}' as 한국어월, '${YEAR_KR}' as 한국어년도"
26
+
},
27
+
{
28
+
"name": "파일명생성예제",
29
+
"use": true,
30
+
"query": "SELECT '${department}' as 부서명, 'Report_${DATE_YYYYMMDD}_${department}.xlsx' as 추천파일명, '${KOREAN_DATE} ${WEEKDAY_KR} 리포트' as 제목예시, 'WHERE created_date >= ''${DATE_YYYY_MM_DD}'' AND department = ''${department}''' as 쿼리조건예시"
31
+
},
32
+
{
33
+
"name": "타임스탬프활용",
34
+
"use": true,
35
+
"query": "SELECT '${UNIX_TIMESTAMP}' as 유닉스타임스탬프, '${TIMESTAMP_MS}' as 밀리초타임스탬프, '${ISO_TIMESTAMP}' as ISO형식, '${DATETIME_YYYYMMDD_HHMMSS}' as 파일명용시각, 'backup_${DATE_YYYYMMDD}_${department}' as 백업파일명예시"
0 commit comments