hello,
I have several file type 2003_050
With the year 2003 and the day 050 days of the year, making March 19.
I want to use a program to convert all my file number in dd / mm / yyyy.
Thank you for your reply
Printable View
hello,
I have several file type 2003_050
With the year 2003 and the day 050 days of the year, making March 19.
I want to use a program to convert all my file number in dd / mm / yyyy.
Thank you for your reply
Frankly, I rather recommend yyyy-mm-dd format (for correct sorting in Explorer).
But apart from that, no, I do not know of any program for that.
Yes you're right but no matter what the format is essential to make the conversion.
Thanks for your suggestion.
For the conversion you can do like this:
conv.bat
ResultCode:@ echo off
set example = 2003_050
:: Extraction of the Year
set A =% EXAMPLE: ~ 0.4%
:: Extraction of Quantième
set / a Q = 1% EXAMPLE: ~ 5,3% - 1000
:: Calculation of Julian day from 1 January of the year%% A +% Q% days
set / a = JJ% Q% + ((1461 * (% A +% 4800 + (1 - 14) / 12)) / 4 + (367 * (1 - 2 - 12 * ((1 - 14) / 12 ))) / 12 - (3 * ((%% A + 4900 + (1 - 14) / 12) / 100)) / 4 + 1 - 32075) - 1
:: Convert Julian Day to Day (% J%), Month (M%%) and Year (% A%)
set / a T0 =% DD% + 68569
set / a T1 = (T0 *% 4%) / 146097
set / a T0 = T0%% - (146097 *% Q1% + 3) / 4
set / a T2 = (4000 * (%% T0 + 1)) / 1461001
set / a T0 = T0%% - (1461 *% Q2%) / 4 + 31
set / a T3 = (80 *% T0%) / 2447
set / a J = T0%% - (2447 *% Q3%) / 80
set / a M =% Q3% + 2 - (12 * (% Q3% / 11))
set / a A = 100 * (% Q1% - 49) +% +% Q2 (% T3% / 11)
:: Formatting resultat
if% J% LSS 10 set J = J% 0%
if% M% LSS 10 set M = M% 0%
echo.
Before conversion echo:%% EXAMPLE
echo after conversion:% A% M% _% _% J%
echo. & Pause
Quote:
Before conversion: 2003_050
After conversion: 2003_02_19
Press any key to continue ...
I thank you for your answer but I am not programming savvy therefore you can tell me how to run this program (with what software);
On the other hand is what the code you have given m I can directly rename a file or I have to do an extra manipulation?
Actually I managed to run the script by creating a bat file. But how I do I do if I want to rename the file name.
Thank you for your answer