Skip to Content
0

Date Formatter

Mar 02, 2017 at 08:45 AM

43

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

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'}}"/>
Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Mar 02, 2017 at 12:10 PM
1

try this.

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

yyyy-mm-dd

'} }"

Share
10 |10000 characters needed characters left characters exceeded