Show date fields with another format

  • 18 February 2019
  • 5 replies

Badge +1

In my applications that I've build so far in my training, i've struggle finding a way to change the format of dates shown in my pages. At the moment it's like this:


But what I want is this:


What is the proper way to achieve this?

Best answer by Robert Jan de Nie 18 February 2019, 11:52

View original

5 replies

Userlevel 6
Badge +5
By default, the date-format is related to the chosen user language, the GUI starts up in. So for (US) English, the default format would be mm/dd/yyyy. It is possible to override this within the extended properties of the Runtime Configuration. Set the property customdatemask to dd-MM-yyyy for your required date format.

Within reports (for instance Crystal Reports) there are also settings to change the date format to any given format, but I usually prefer to let SQL server handle date formatting for me using the CONVERT function. For more information on the CONVERT function, please look at the Microsoft documentation:
Userlevel 7
There is also an extended property UseWindowsCulture available. Set this property to 'true' to use the Windows Region settings for dates, times and numbers instead of the default settings derived from the Thinkwise application language ID.

Note that the region settings for the application language are used, not the current Windows language.

Badge +1
@Robert Jan de Nie
Thank you for your reply. What type of function in SF do you advice to use a convert statement in?
Userlevel 6
Badge +5
I'd create a function within SF that handles date-to-string formatting, in order to have one point of reference.

The function would be something like this:

--create function
create or alter function dbo.convert_date_to_string (@date datetime2)
returns varchar(100)

return (select convert(varchar, @date, 105)) --105 = dd-mm-yyyy


--test function
select dbo.convert_date_to_string(getdate())
Badge +2

I was just trying this and it doesn’t seem to work in the universal interface.

I added the setting “customdatemask” with “dd-MM-yyyy” as value and that doesn’t seem to work.

Is there another way to do this?