--- title: "Set Date format on Windows devices" slug: "set-date-format-on-windows-devices" updated: 2024-05-17T14:43:17Z published: 2024-05-17T14:43:17Z canonical: "help.scalefusion.com/set-date-format-on-windows-devices" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.scalefusion.com/llms.txt > Use this file to discover all available pages before exploring further. # Set Date format on Windows devices The following PowerShell script helps the IT Admins to change the date format on their managed Windows devices. 1. Create a file on your desktop, for example, set_date_format.ps1 and open it in a text editor like notepad++ 2. Copy the contents below to the file or click [here](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/set%20a%20date%20format%20.ps1) to download the file. 1. ‘**sShortDate**’ key is to set Short date format, eg. D/M/yy (5/7/22) 2. ‘**sLongDat**e’ key is to set Long date format, eg. dddd, MMMM d, yyyy (Friday, January 5, 2024). ```powershell $dateFormat = 'MM/dd/yyyy' Write-Host "Starting script execution..." try{    $status = New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS    Function Set-DateFormat($sid)    {        if(Test-Path "HKU:\${sid}")        {            Write-Host "updating date format for user:",$sid            Set-ItemProperty -path "HKU:\${sid}\Control Panel\International\" -name 'sShortDate' -value $dateFormat        }    }    $userDetails=Get-wmiobject win32_useraccount | where-object{$_.status -eq 'ok'}    foreach($user in $userDetails){        $sid=$user.SID        Set-DateFormat($sid)    } } catch {    Write-Output "Error occured while running script -> ",$_.Exception.Message } Write-Output "Script execution completed successfully!" ``` 3. Follow [our guide](/docs/deploy-powershell-scripts-using-scalefusion) to upload & publish the PowerShell script using Scalefusion Dashboard. 4. Please make sure to select the Execution Policy as below **a. Execution Level : Device b. Execution Context : Enrolled User** > [!NOTE] > The specified date format is applied only to the user accounts logged in while executing the script. > [!CAUTION] > Please note that to use the PowerShell scripts, the Scalefusion MDM Agent Application must be installed on the device(s). Please follow [our guide](/docs/scalefusion-mdm-agent-application) to publish and install the Scalefusion MDM Agent Application. > [!CAUTION] > Notes: > > 1. The scripts and their contents are sourced from various albeit authenticated Microsoft sources and forums. > 2. Please validate the scripts on a test machine before deploying them on all your managed devices. > 3. Scalefusion has tested these scripts, however, Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the incorrect usage of these scripts.