Use default field type(s) within my plugin I am just experimenting with plugin development and would like to use the existing dateTime field type. For no other reason than to maintain consistency throughout my application.

Is there a way to call that field as a macro (for lack of better words) in my template or do I just view the generated source from one spot and copy/paste it into my templates?

Thank you!
All the default field types are exposed as template macros in /craft/app/templates/_includes/forms.html. Here's how you could easily create a DateTime input field:

{% import '_includes/forms' as forms %}

{{ forms.date( {
    id : 'myDateField',
    name : 'myDateField',
    value : myDate | default
} ) }}


Note that for the date field, value needs to be a valid DateTime object.

Other input types – such as a plain text field – are created in a similar manner:

{{ forms.text( {
    id: 'myTextField',
    name: 'myTextField',
    value : myValue | default,
    placeholder : 'My Placeholder',
} ) }}


Also note that as _includes/forms is outside the frontend templates folder, it will not be easily accessible outside the CP. If you want to include the form macros in a frontend template, see the following SE thread – I'm partial to Mike Pepper's answer, myself.