Expand my Community achievements bar.

Date() format in Livecycle designer

Avatar

Level 2

Hello All

I have a requirement where in I should display the date/time in a seperate field when the user starts typing in a text field.

I have the following code in the change event of text field in which user types:

datetimefield.rawValue=Date();

datetimefield is a Date/Time field with value type 'calculated- Read Only' and display pattern of  date{yyyy-mm-dd} time{hh:mm:ss}

Under the binding tab, the data form is set to 'Date and Time'

Now, when start typing in the text field, the date and time is displayed however, not in the format I want.

I am getting output as 'Wed Apr 15 2009 14:18:51 GMT-0400 (Eastern Daylight Time)'

I want the output to be 'Wed Apr 15 2009 14:18' or something similar. I donot want the <SS> and GMT information.

Appreciate any help.

2 Replies

Avatar

Level 2

Iam converting it to String and doing a Substring..Just wondering if there is a better way.

Avatar

Former Community Member

Old thread but thought I would answer to help others.

What he wanted was to go back to the field tab of the object inspector and edit the display pattern and the data pattern.