# inputEx - DateTimeField Usage

## Basic DateTimeField creation

Use the following code to create a basic inputEx DateTimeField.

// Example 1 field = new inputEx.DateTimeField({parentEl: 'container1', value: new Date()}); var button = inputEx.cn('button', null, null, 'getValue'); YAHOO.util.Event.addListener(button, "click",function() { alert(field.getValue()); }); YAHOO.util.Dom.get('container1').appendChild(button);

## Date format

Change the date format

new inputEx.DateTimeField({parentEl: 'container2', value: new Date(), dateFormat: 'd/m/Y'});