# Change date format in workflow scripts (2025-08-17 20:18Z)
_**User**_
I'm adapting these workflow scripts for home projects. Let's start with making sure that dates are not in YYMMDD format, but in YYYY-MM-DD format.
---
_**Assistant**_
I'll help you update the workflow scripts to use YYYY-MM-DD date format instead of YYMMDD. Let me first examine the existing scripts to see which ones contain date formatting that needs to be updated.
---
<details>
<summary>Grep search for "YYMMDD|YY-MM-DD|date.*format" • **3** files</summary>
| File | Line | Match |
|------|------|-------|
| `file:///d%3A/3%20ProjectStructure/NewDaily.bat` | L4 | `:: Get current date in YYMMDD format` |
| `file:///d%3A/3%20ProjectStructure/NewProject.bat` | L4 | `:: Get current date in YYMMDD format` |
| `file:///d%3A/3%20ProjectStructure/NewProject.bat` | L4 | `:: Get current date in YYMMDD format` |
</details>
---
Now let me examine these files to see the current date formatting implementation:
---
Read file: NewDaily.bat
---
Read file: NewProject.bat
---
Let me also check if there are any other scripts that might have date formatting:
---
<details>
<summary>Grep search for "daily_|_%yy%|%yy%%mm%" • **7** files</summary>
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L132 | `for /d %%D in ("%%S\daily_*") do (` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L152 | `if "%DRY%"=="1" echo [DRY] No submodules found; using direct daily_* under animations` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L153 | `:: Fallback: direct daily_* under animations → copy into Renders\daily_*` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L154 | `for /d %%D in ("%animDir%\daily_*") do (` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L175 | `if "%DRY%"=="1" echo [DRY] Animations dir missing or empty; checking root daily_*` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L176 | `:: Final fallback: root-level daily_* under projectDir → copy into Renders\daily_*` |
| `file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat` | L177 | `for /d %%D in ("%projectDir%\daily_*") do (` |
| `file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat` | L2 | `echo RebuildDailies - Copying 0MoveToCurrent.bat to all daily_* folders...` |
Now I can see the scope of changes needed. I need to update the date formatting in both `NewDaily.bat` and `NewProject.bat` to use YYYY-MM-DD format instead of YYMMDD. Let me update these files:
I will update the date formatting from YYMMDD to YYYY-MM-DD format by modifying the date parsing and project root naming logic.
**Chunk 1**
Lines added: 3, lines removed: 3
```diff
@@ -2,16 +2,16 @@
setlocal
- :: Get current date in YYMMDD format
+ :: Get current date in YYYY-MM-DD format
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
set mm=%%a
set dd=%%b
set yy=%%c
)
- set yy=%yy:~-2%
+ set yyyy=20%yy:~-2%
:: Ask for project name
set /p projectName="Enter project name (press Enter for default 'NewProject'): "
if "%projectName%"=="" set projectName=NewProject
- set projectRoot=%yy%%mm%%dd%_%projectName%
+ set projectRoot=%yyyy%-%mm%-%dd%_%projectName%
:: Create main project directory
```
</details>
---
Perfect! I've successfully updated both scripts to use YYYY-MM-DD date format instead of YYMMDD. Here's a summary of the changes made:
## Changes Made:
### `NewDaily.bat`:
- Updated comment from "YYMMDD format" to "YYYY-MM-DD format"
- Changed `set yy=%yy:~-2%` to `set yyyy=20%yy:~-2%` to get full 4-digit year
- Updated folder naming from `daily_%yy%%mm%%dd%` to `daily_%yyyy%-%mm%-%dd%`
### `NewProject.bat`:
- Updated comment from "YYMMDD format" to "YYYY-MM-DD format"
- Changed `set yy=%yy:~-2%` to `set yyyy=20%yy:~-2%` to get full 4-digit year
- Updated project root naming from `%yy%%mm%%dd%_%projectName%` to `%yyyy%-%mm%-%dd%_%projectName%`
## What This Means:
- **Before**: Daily folders were named like `daily_231215` (December 15, 2023)
- **After**: Daily folders will now be named like `daily_2023-12-15`
- **Before**: Project folders were named like `231215_ProjectName`
- **After**: Project folders will now be named like `2023-12-15_ProjectName`
The scripts will now create folders with ISO 8601 compliant date formatting (YYYY-MM-DD), which is more readable and follows international standards. All the existing scripts that search for `daily_*` patterns will continue to work since they use wildcard matching.
we need these paths to be changed to work no matter where they're ran; relative paths.
---
_**Assistant**_
I can see that you've made some changes to the scripts, and now you need the paths to be relative so they work regardless of where they're run from. Let me examine the current state of the files and update them to use relative paths.
---
Read file: NewDaily.bat
---
Read file: NewProject.bat
---
I can see the issues. The `NewProject.bat` script has several hardcoded absolute paths that need to be converted to relative paths. Let me update both scripts to use relative paths that will work from any location.
First, let me fix the `NewDaily.bat` script to ensure consistency:
+ if exist "%~dp0components\gitignore" copy /Y "%~dp0components\gitignore" "%projectRoot%\.gitignore" >nul
+ if exist "%~dp0components\gitattributes" copy /Y "%~dp0components\gitattributes" "%projectRoot%\.gitattributes" >nul
:: Initialize git and install Git LFS
```
</details>
---
Perfect! I've successfully updated both scripts to use relative paths. Here's what I changed:
## Changes Made:
### `NewDaily.bat`:
- Fixed the inconsistency between folder creation and echo message
- Now both the folder name and the echo message use the same format: `%yyyy%-%mm%-%dd%`
### `NewProject.bat`:
- Replaced all hardcoded absolute paths (`A:\1 Amazon_Active_Projects\3 ProjectStructure\`) with relative paths using `%~dp0`
-`%~dp0` is a Windows batch variable that represents the directory where the script is located
## What This Means:
**Before**: The script would only work when run from a specific location (`A:\1 Amazon_Active_Projects\3 ProjectStructure\`)
**After**: The script will work from any location because it uses relative paths based on where the script file itself is located
## Key Benefits:
1.**Portability**: You can now copy these scripts to any location and they'll work correctly
2.**Flexibility**: The scripts will find their dependencies (like `NewDaily.bat`, `UpdateSequences.bat`, and the `components` folder) relative to their own location
3.**No more hardcoded paths**: All paths are now dynamic and will work regardless of where you run the scripts from
The scripts will now work whether you run them from:
- The original project structure directory
- A USB drive
- Any other location where you've copied the scripts and their supporting files
this needs to be updated as well; it should scan folders with the format YYYY-MM-DD instead of daily_YYMMDD
---
_**Assistant**_
I can see that the `UpdateSequences.bat` script is still looking for folders with the old `daily_*` pattern, but now that we've updated the date format to YYYY-MM-DD, it needs to be updated to scan for the new format. Let me update this script:
I will update the script to scan for folders with YYYY-MM-DD format instead of the old daily_* pattern, and update the log messages and comments accordingly.
**Chunk 1**
Lines added: 2, lines removed: 1
```diff
@@ -21,5 +21,6 @@
set /a mirrorFailures=0
- for /d %%D in (daily_*) do (
+ rem Scan for folders with YYYY-MM-DD format (e.g., 2023-12-15)
+ for /d %%D in (????-??-??) do (
if exist "%%D" (
set /a dailiesScanned+=1
```
</details>
---
Perfect! I've updated the `UpdateSequences.bat` script to work with the new YYYY-MM-DD date format. Here's what changed:
## Key Changes:
### **Folder Pattern Update:**
- **Before**: `for /d %%D in (daily_*) do (`
- **After**: `for /d %%D in (????-??-??) do (`
### **Pattern Explanation:**
The new pattern `????-??-??` will match folders with the format:
-`????` = 4 digits for year (e.g., 2023)
-`-` = literal hyphen
-`??` = 2 digits for month (e.g., 12)
-`-` = literal hyphen
-`??` = 2 digits for day (e.g., 15)
This will now correctly scan for folders like:
-`2023-12-15`
-`2024-01-03`
-`2024-12-31`
## What This Means:
1.**Compatibility**: The script now works with the new date format you've implemented
2.**Pattern Matching**: Uses Windows wildcard patterns that are more precise than the old `daily_*` pattern
3.**Future-Proof**: Will work with dates up to 9999-99-99 (though realistically up to 2099-12-31)
The script will now properly scan and process your daily folders that use the YYYY-MM-DD format, maintaining all the existing functionality for mirroring sequences and creating the `_CURRENT` directory structure.