Change Date Format

Overview

By default, GoodData displays the date attributes in the en-US format.

You can enable a different date format for your organization, workspace, or even for individual users. Date attributes are then displayed in the format that you select.

You can select from the following predefined date formats based on the ICU standard: Chinese, Czech, Dutch, English (GB), English (US), French, German, Japanese, Portuguese (Brazil), Portuguese (Portugal), Russian, Spanish.

Change the Date Format

To change the date format:

  1. Create the formatLocale setting.
  2. Enable the format that you want to use.

The following table shows the IDs that you can use to enable the date formats:

FormatFormat ID
Chinesezh-CN
Czechcs-CZ
Dutchnl-NL
English GBen-GB
English US (default)en-US
Frenchfr-FR
Germande-DE
Japaneseja-JP
Portuguese (Brazil)pt-BR
Portuguese (Portugal)pt-PT
Russianru-RU
Spanishes-ES

Organization

To change the date format for the whole organization, follow these instructions:

API (Bash)
API (Powershell)

To create the formatLocale organization settings, send the following POST request /api/v1/entities/organizationSettings:

curl $ENDPOINT/api/v1/entities/organizationSettings \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X POST \
  -d '{
    "data":
    {
        "type": "organizationSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To enable a different date format, send the following PUT request /api/v1/entities/organizationSettings/formatLocale:

curl $ENDPOINT/api/v1/entities/organizationSettings/formatLocale \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X POST \
  -d '{
    "data":
    {
        "type": "organizationSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To create the formatLocale organization settings, send the following POST request /api/v1/entities/organizationSettings:

Invoke-RestMethod -Method Post -Uri '$ENDPOINT/api/v1/entities/organizationSettings' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "organizationSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json

To enable a different date format, send the following PUT request /api/v1/entities/organizationSettings/formatLocale:

Invoke-RestMethod -Method Post -Uri '$ENDPOINT/api/v1/entities/organizationSettings/formatLocale' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "organizationSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json

Workspace

To change the date format for individual workspaces, follow these instructions:

API (Bash)
API (Powershell)

To create the formatLocale workspace settings, send the following POST request /api/v1/entities/workspaceSettings:

curl $ENDPOINT/api/v1/entities/workspaces/{WORKSPACE_ID}/workspaceSettings \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X POST \
  -d '{
    "data":
    {
        "type": "workspaceSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To enable a different date format, send the following PUT request /api/v1/entities/workspaceSettings/formatLocale:

curl $ENDPOINT/api/v1/entities/workspaces/{WORKSPACE_ID}/workspaceSettings/formatLocale \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X PUT \
  -d '{
    "data":
    {
        "type": "workspaceSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To create the formatLocale workspace settings, send the following POST request /api/v1/entities/workspaceSettings:

Invoke-RestMethod -Method Post -Uri '$ENDPOINT/api/v1/entities/workspaces/{WORKSPACE_ID}/workspaceSettings' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "workspaceSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json

To enable a different date format, send the following PUT request /api/v1/entities/workspaceSettings/formatLocale:

Invoke-RestMethod -Method Put -Uri '$ENDPOINT/api/v1/entities/workspaces/{WORKSPACE_ID}/workspaceSettings/formatLocale' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "workspaceSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json

User

To change the date format for individual users, follow these instructions:

API (Bash)
API (Powershell)

To create the formatLocale user settings, send the following POST request /api/v1/entities/userSettings:

curl $ENDPOINT/api/v1/entities/users/{USER_ID}/userSettings \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X POST \
  -d '{
    "data":
    {
        "type": "userSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To enable a different date format, send the following PUT request /api/v1/entities/userSettings/formatLocale:

curl $ENDPOINT/api/v1/entities/users/{USER_ID}/userSettings/formatLocale \
  -H "Content-Type: application/vnd.gooddata.api+json" \
  -H "Accept: application/vnd.gooddata.api+json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -X PUT \
  -d '{
    "data":
    {
        "type": "userSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | jq .

To create the formatLocale user settings, send the following POST request /api/v1/entities/userSettings:

Invoke-RestMethod -Method Post -Uri '$ENDPOINT/api/v1/entities/users/{USER_ID}/userSettings' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "userSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json

To enable a different date format, send the following PUT request /api/v1/entities/userSettings/formatLocale:

Invoke-RestMethod -Method Put -Uri '$ENDPOINT/api/v1/entities/users/{USER_ID}/userSettings/formatLocale' `
-ContentType 'application/vnd.gooddata.api+json' `
-H @{ 
    'Accept' = 'application/vnd.gooddata.api+json'
    'Authorization' = 'Bearer {API_TOKEN}' 
} `
-Body '{
    "data":
    {
        "type": "userSetting",
        "id": "formatLocale",
        "attributes": {
            "content": {"value": "{FORMAT_ID}"}
        }
    }
}' | ConvertTo-Json