Skip to main content
deleted 7 characters in body
Source Link
Taras
  • 35.9k
  • 7
  • 77
  • 153

The problem

I useIn QGIS 3.34 Prizren., I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date", 'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to GeopackageGeoPackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locale to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone-prone.

enter image description here

enter image description here

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locale to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

The problem

In QGIS 3.34 Prizren, I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date("date", 'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to GeoPackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locale to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error-prone.

enter image description here

enter image description here

fixed typo
Source Link
Matt
  • 19.5k
  • 4
  • 25
  • 64

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the localslocale to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locals to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.


The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locale to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

added 2 characters in body
Source Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 353

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.

 

Edit: TheThe issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locals to "French France" works (after restart of QGIS, thanks for theusing hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.

Edit: The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locals to "French France" works (after restart of QGIS, thanks for the hint @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

The problem

I use QGIS 3.34 Prizren. I have an attribute field of date type. Unfortunately, years are shown only with two digits: 23 instead of 2023. As a historian, this is really bad as it could be also 1923, 1823 etc. I know that internally, QGIS uses the correct, 4-digit year values. But for reading the attribute table, I want to see the full numbers.

The Question

How can I show the date in a format with years with actual, four-digit numbers?

What I tried

I tried to use format_date ("date",'dd. MM. yyyy'), however, to no avail: in the preview, the desired format shows up, but when the field is created, all values are set to NULL. This applied to temporary scratch layers as well as to Geopackage layers.

I also tried Menu Settings > Options > General. I can change the Locale settings, but this does not affect the two-digit representation of the years.

 

The issue seems to be a newer one, as a year before (must have been QGIS 3.28), with the same settings, I had 4-digit numbers for the year (compare with 2nd screenshot below). Setting the locals to "French France" works (after restart of QGIS, using hint of @user30184). However, I would like to get 4-digit years in my locale "German Switzerland" as it was possible in older versions.

It is also strange that in my Windows 10 system Region settings, the year appears in 4 digits, even the "short version" (see screenshot, highlighted in red). It seems that in newer versions, QGIS does not respect system settings...

enter image description here

A workaround

I could, of course, create a new field of type text/string and create a correctly looking date, but I try to avoid this as it is not very elegant and error prone.

enter image description here

enter image description here

added 324 characters in body
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245
Loading
added 399 characters in body
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245
Loading
Source Link
Babel
  • 80.4k
  • 15
  • 97
  • 245
Loading