Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Keep zero in date format

gretchenhs42
Level 3
Level 3

I've been searching and searching for this answer.

I have a Date field in a form on LiveCycle.

This is not a field that anyone enters the date, but it simply puts the current date in.

I would like it to keep the 0's in the format.  So if the date is 01/08/2014, I want it to read as this, not 1/8/14.

I'm using this value in an invoice field where I am concating two fields together and I want the 0's to stay.

Any help would be great.  Thanks!

0 Replies
radzmar
Level 10
Level 10

Hi,

you need to define a display pattern for the date field, to get the desired formatting.

Add this display pattern to your field.

date{MM/DD/YYYY}

gretchenhs42
Level 3
Level 3

I tried this earlier and again just now and it refuses to put the zeros in.

When I test the form it still comes up, 1/8/14.

gretchenhs42
Level 3
Level 3

It's a Calculated - Read Only field and I use FormCalc

 

$.rawValue

= num2date(date(),

DateFmt(1))

radzmar
Level 10
Level 10

Ok, that's the reason why the date is displayed in that way.

DateFmt(1) returns the short style M/D/YY.

Use DateFmt(2, $.locale) instead.

gretchenhs42
Level 3
Level 3

That makes sense, is there a table somewhere that explains all the Date Formats?

This is now saying Jan 8, 2014.