Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Date formatting

  • jaws40
  • jaws40's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 5 months ago #127571 by jaws40
Date formatting was created by jaws40
In the date field i use the calendar and format dd-mm-yyyy {date}
So far so good
In the next field i want to show the date variabele that was selected in the prev question {date}
IT shows the variable but in the wrong format ( years first US format ) including minutes en seconds.
How can I format this variable so iT just shows dd-mm-yyyy ?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 5 months ago - 8 years 5 months ago #127595 by tpartner
Replied by tpartner on topic Date formatting
There may be a more clever method but this should work (assuming the date question code is "date"):

Code:
{substr(date, 8, 2)}-{substr(date, 5, 2)}-{substr(date, 0, 4)}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 5 months ago by tpartner.
The topic has been locked.
  • jaws40
  • jaws40's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 5 months ago #127641 by jaws40
Replied by jaws40 on topic Date formatting
I think i found the answer. Using the Shown command after the variable (variable.shown) does the trick
The following user(s) said Thank You: holch
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose