Files
ProjectStructure_HOME/.specstory/history/2025-08-17_20-18Z-change-date-format-in-workflow-scripts.md
2025-08-17 14:22:09 -06:00

8.6 KiB

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.


Grep search for "YYMMDD|YY-MM-DD|date.*format" • **3** files
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

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:


Grep search for "daily_|_%yy%|%yy%%mm%" • **7** files
File Line Match
file:///d%3A/3%20ProjectStructure/NewDaily.bat L13 mkdir "daily_%yy%%mm%%dd%"
file:///d%3A/3%20ProjectStructure/NewDaily.bat L14 echo Daily folder created: daily_%yy%%mm%%dd%
file:///d%3A/3%20ProjectStructure/UpdateSequences.bat L23 for /d %%D in (daily_*) do (
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L3 echo PushAllToCurrent - Running all 0MoveToCurrent.bat files in daily_ folders...
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L6 echo Searching for daily_ folders and 0MoveToCurrent.bat files...
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L9 REM Find all daily_ folders and check for 0MoveToCurrent.bat
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L13 echo Found the following daily_ folders with 0MoveToCurrent.bat:
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L14 for /d %%D in (daily_*) do (
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L22 echo No daily_ folders with 0MoveToCurrent.bat found!
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L33 REM Execute each 0MoveToCurrent.bat found in daily_ folders
file:///d%3A/3%20ProjectStructure/scripts_old/PushAllToCurrent.bat L34 for /d %%D in (daily_*) do (
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L9 :: - Collects seq/ outputs from daily_* folders under Blends\animations (with submodule support)
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L92 :: Collect seq outputs from daily_* into Renders
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L100 :: Detect submodules: first-level folders under animations that contain daily_*
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L104 if /I not "!prefix!"=="daily_" (
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L105 for /d %%D in ("%%S\daily_*") do (
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L109 if exist "%%S\daily_*" echo [DRY] Detected submodule: "%%~nS"
file:///d%3A/3%20ProjectStructure/UpgradeToGitProj.bat L119 if /I not "!prefix!"=="daily_" (
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...
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L12 REM Search for daily_* folders recursively
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L13 echo Searching for daily_* folders in all subfolders...
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L17 echo Found the following daily_* folders:
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L18 for /f "delims=" %%D in ('dir /s /b /ad "*daily_*" 2^>nul') do echo - %%D
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L24 REM Copy the file to each daily_* folder found recursively
file:///d%3A/3%20ProjectStructure/scripts_old/RebuildDailies.bat L26 for /f "delims=" %%D in ('dir /s /b /ad "*daily_*" 2^>nul') do (
file:///d%3A/3%20ProjectStructure/NewProject.bat L15 set projectRoot=%yy%%mm%%dd%_%projectName%
file:///d%3A/3%20ProjectStructure/NewProject.bat L15 set projectRoot=%yy%%mm%%dd%_%projectName%

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:


Edit file: NewDaily.bat

I will update the date formatting from YYMMDD to YYYY-MM-DD format by modifying the date parsing and folder naming logic.

Chunk 1 Lines added: 4, lines removed: 4

@@ -2,15 +2,15 @@
  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%
  
  :: Create daily folder
- mkdir "daily_%yy%%mm%%dd%"
- echo Daily folder created: daily_%yy%%mm%%dd%
+ mkdir "daily_%yyyy%-%mm%-%dd%"
+ echo Daily folder created: daily_%yyyy%-%mm%-%dd%
  
  pause

Edit file: NewProject.bat

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

@@ -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

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.