# Ant User Manual

## Touch

### Description

Changes the modification time of a file and possibly creates it at the same time.

For JDK 1.1 only the creation of new files with a modification time of now works, all other cases will emit a warning.

### Parameters

Attribute | Description | Required
file | the name of the file | Yes
millis | specifies the new modification time of the file in milliseconds since midnight Jan 1 1970 | No
datetime | specifies the new modification time of the file in the format MM/DD/YYYY HH:MM AM_or_PM. | No

If both `millis` and `datetime` are omitted the current time is assumed.

### Examples

      <touch file="myfile"/>

creates `myfile` if it doesn't exist and changes the modification time to the current time.

      <touch file="myfile" datetime="06/28/2000 2:02 pm"/>

creates `myfile` if it doesn't exist and changes the modification time to Jun, 28 2000 2:02 pm (14:02 for those used to 24 hour times).

Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.