> For the complete documentation index, see [llms.txt](https://docs.smt-x.com/smtx-online-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smt-x.com/smtx-online-documentation/catalog/catalog-maintenance/add-a-field-to-a-template/default-value.md).

# Default value

In default value, you can pre-fill the field with any contents, or coming from another field.

## Showing a date field in readable format

When showing a date-field, it will display as it is stored in the database, so in the format yyyyMMdd:hh:mm:ss.

This is not very readable, use this Javascript to define the display:

return CommonInterface.utcDateToString(CommonInterface.stringToDate(#REPLACE-PARTVALUE-Date1||#, "yyyyMMddHHmmss"), 'dd/MM/yyyy');

NOTE: set as Default value type: Javascript.

## Data field: set current date as default value

Type : Javascript

Default value: return CommonInterface.utcDateToString(new Date(),'yyyyMMdd');

Note: set the field type as Date !
