I am trying to get the document creation date using below expression function.

I am trying to get the document creation date using below expression function.
documents(local!documentsList,"dateCreated"), It is returning me dates in "2014-09-03 06:45:46.0" format. I am trying to convert that into dd/MM/yyyy format using datetext function. what is the best way to convert the above date format into dd/MM/yyyy ?
i used datetext("2014-09-03","dd/MM/yyyy") to convert but it threw error saying "invalid parameters passed" even for datetext(tostring("2014-09-03"),"dd/MM/yyyy") .

My use case is to get the list of documents from a folder that were created before given date time.
...

OriginalPostID-128967

OriginalPostID-128967

  Discussion posts and replies are publicly visible

Parents
  • Not sure about the "documents" function since that's a plug-in but using the "document" function works perfectly fine since the returned object is a dateTime not a text, therefore the format is irrelevant, but the document() function only works with a single document which means that you will need to use looping functions (i.e. apply())

    =datetext(document(ri!myDocument,"dateCreated"),"dd/MM/yyyy")

    This test allows you to confirm the out of the box function returns a date and time

    =typename(typeof(document(ri!myDocument,"dateCreated")))

    you may want to try the same with the documents() function to see what it returns


    =typename(typeof(document(ri!mydocumentsList,"dateCreated")))
Reply
  • Not sure about the "documents" function since that's a plug-in but using the "document" function works perfectly fine since the returned object is a dateTime not a text, therefore the format is irrelevant, but the document() function only works with a single document which means that you will need to use looping functions (i.e. apply())

    =datetext(document(ri!myDocument,"dateCreated"),"dd/MM/yyyy")

    This test allows you to confirm the out of the box function returns a date and time

    =typename(typeof(document(ri!myDocument,"dateCreated")))

    you may want to try the same with the documents() function to see what it returns


    =typename(typeof(document(ri!mydocumentsList,"dateCreated")))
Children
No Data