Date from DateTime

0
?Since it’s impossible to just remove time from datetime in mendix i want to do the following. Now I have 2 atributes: - DateGame (=DateTime) - GameDateString (=String) What i want is a GameDateString to show the format ‘01-01-2019’ or ‘01/01/2019’ (preferably day month year) Is there a solution to do this?
asked
4 answers
6

If you only want to fill your string you could use the formatDateTime() function;

formatDateTime($DateTime, ‘dd.mm.yyyy’)

answered
1

A solution is ignoring the time part by setting the Dateformat of the datebox to ‘Date’ every time you show it to the user.

This also removes the need for the redundant GameDateString, which you can now delete.

answered
0

If time really bothers you that much, you can always remove it by using a trimToDays() function before saving it.

The standard date widget has formatting options (which usually do not show time – refer to section 2.6), does this not suffice for displaying purposes?

answered
0

UPDATE:
The problem is i want to use the date as an input for the x-axis of a line chart. I already set the Date format of the “Date Picker input field” to ‘Date’ but it still shows the hours, …

So currently i get the following graph:

What i want is the following:

answered