Skip to Content

Date Formatter

Hi All ,

I have a date field like this 20080122095308 and i want to display it in a simple format

like yyyy-mm-dd hh:mm:ss or just yyyy-mm-dd

"{path: '/GenerationTime', type: 'sap.ui.model.type.datetime', formatOptions: { style: 'full', source: { pattern: 'yyyy/MM/dd HH:mm:ss' } } }"

this code doesn't work

Can anyone help in solving this issue?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 02, 2017 at 01:45 PM
    -1

    Hi,

    Ensure you code is written in correct Upper and Lower cases - (DateTime).

    <Text text="{path: '/GenerationTime',type: 'sap.ui.model.type.DateTime',formatOptions: {pattern: 'yyyy-MM-dd HH:mm:ss'}}"/>
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 02, 2017 at 12:10 PM

    try this.

    "{path: '/GenerationTime', type: 'sap.ui.model.type.datetime', formatOptions: { style: 'full', source: { pattern: 'yyyyMMddHHmmss' } ,pattern:'

    yyyy-mm-dd

    '} }"

    Add comment
    10|10000 characters needed characters exceeded