Solved
Show date fields with another format
Hi,
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:
mm/dd/yyyy
But what I want is this:
dd-mm-yyyy
What is the proper way to achieve this?
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:
mm/dd/yyyy
But what I want is this:
dd-mm-yyyy
What is the proper way to achieve this?
Best answer by Robert Jan de Nie
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: https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-2017
View originalWithin 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: https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-2017
This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.