LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Date conversion from 2014-01-10 to 10/01/2014

    Employee
    Posted 03-28-2014 05:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Hi Team,

    i want to convert the Date from CCYY-MM-DD to DD/MM/CCYY (example - 2013-01-10 to 10/01/2013).
    Please help me how can we get the dates as required formats.
    Thanks in advance.


  • 2.  RE: Date conversion from 2014-01-10 to 10/01/2014

    Employee
    Posted 03-28-2014 09:40

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    Internally the system stores a date type field as CCYY-MM-DD and that is the format that you will see in the BRDViewer. If you want to see the data in a different format you can convert it to a string.

    FormattedDate = myDate.month().str().pad(2) + "/" + myDate.day().str().pad(2) + "/" + myDate.year()

    The pad(2) function will ensure that all month and day values are 2 digits. Anything 1-9 will be prefaced with a zero.

    The variable FormattedDate will contain a string in the form "MM/DD/YYYY". If you want to do use the date functions, then you will need to convert it back to a date type.

    Thanks,
    Larry