Pages:
Actions
  • #1 by Reggie on 05 Feb 2021
  • Hi team,

    We have a variable now_time_datestr which return the date in the format dd/mm/yyyy.

    Could we have a variable that reverses that, without the slashes as well. So in the format yyyymmdd. This would really help with sorting files etc into date order.


    Reggie
  • #2 by Oxa (WellDoneSoft) on 09 Feb 2021
  • I'm sorry, there is no quick solution for this, as somebody else would want this in yyyy-mm-dd format or dd.mm.yyyy, etc. Unfortunately, this is not a full-fledged programming language, so we can't afford this level of flexibility.

    You could maybe use the variable as is and later just remove the slashes using some third-party software?
  • #3 by Purity on 10 Feb 2021
  • Possible workaround: If having the date in the filename doesn't matter and you just want the files in date order, then using 'now_time' instead of 'now_time_datestr' would do this - file names would run from lowest number (oldest log) to highest (newest log), with the number increasing by 1 each day. Assuming you're taking the logs into excel then you can get the actual date in the log by applying custom formatting to the cell with the 'now_time' value.
  • #4 by Reggie on 11 Feb 2021
  • No problem Oxa, I wasn't sure how the variable now_time_datestr variable was built. I thought it might formed by already having the year, month and day as separate values. Thanks for getting back to me.


    Purity,

    I think you're on to something here. Using now_time by itself wouldn't work as each entry would be a different file and I want just one file per day. If I use INTEGER(now_time) however, I think this'll do what I'm after. Thanks for pointing me in the right direction.


    Reggie
Pages:
Actions