How to change Windows date from Gregorian date to Umm Al-Qura date
Via batch file how that??


Moderator: DosItHelp
Code: Select all
@echo off &setlocal
:: Year, Month, and Day in the Gregorian Calendar
set /a "gregY=2021, gregM=10, gregD=25"
:: Use the .NET "UmAlQuraCalendar" class in a PowerShell command to convert the date
for /f "tokens=1-3" %%i in (
'powershell.exe -nop -ep Bypass -c "$DT=New-Object DateTime(%gregY%,%gregM%,%gregD%);$UAQ=New-Object Globalization.UmAlQuraCalendar;(''+$UAQ.GetYear($DT)+' '+$UAQ.GetMonth($DT)+' '+$UAQ.GetDayOfMonth($DT))"'
) do set /a "uaqY=%%i, uaqM=%%j, uaqD=%%k"
:: Year, Month, and Day in the Umm Al-Qura Calendar
echo Year %uaqY%
echo Month %uaqM%
echo Day %uaqD%
pause
Are you looking to change the date on the Windows operating system, use a method to convert a date or something else? Unless you can re-phrase the question, the people on this forum will have a hard time assisting you. Is there any code you have tried or resources you have checked?
You are literally just repeating yourself over and over with no new additional information to clarify your question. You were given code two days ago that does what you ask for. If that code is not working or is not what you expected then please explain how it does not work for you. I did verify the code that was posted by user aGerman. If you cannot provide any additional feedback I will just close your question and you can move onto some other computer forum to ask your question.