4 Replies Latest reply on Apr 8, 2016 9:04 AM by Corey Turner

    STR and Replace Formula on Date

    Rahul Ahluwalia

      I have a date field named Date (UTC) which is formatted as such: 1/4/16 9:37:03 PM

      What I want to get to is: 2016-04-01-21-37-03-xxxx where xxxx are the milliseconds in the datetime.


      I was able to accomplish this by doing the following: replace(replace(REPLACE(STR([Date (UTC)]), " ", "-"), ".", "-"), ":", "-")


      This works perfectly, until about 30 minutes (or maybe the next refresh or something) when it changes the output to: Apr--1-2016--9-37PM


      Can anyone guide me why the behavior changes by itself? Is there another way to accomplish the desired solution? The exact format is important as I use it to append to a URL string to drive a URL action on the dashboard.