Date display counting the day of the year

Hi guys!
I’m trying to search the solution but since I’m new, I’ m not able to solve this problem:
I have a date in this format: 18919 that means : 189th day of the year 2019 (that corresponds to 08/07/2019).
I want to display: 08/07/2019.

Do you know how to manage this problem?
thanks for helping!

Like this:

image
You will need

  • a clock component (mine is named DataClock, but you can name anything you want)
  • a variable to hold the 18919 string (I named it “thedate” and it is a local variable, but it could be the label of text field caption, anything at all, actually)

What this does is (going from right to left):

  • create an instant that corresponds to January 1st of the specified year (we extract the last two digits of the date string)
  • add the number of days that correspond to the first part of the date string (note that we use the length of the string, in case the 12th day is written as 1219 instead of 01219. You do not want 1219 to be interpreted as being 121th day of the year 9). This returns an instant.
  • pipe that into FormatDateTime (from an instant) using the pattern you need.

Thank you so much :slight_smile: it works!