Total Pageviews

2006/05/30

[ANT] Date of 05/28/2006 07:06 午後 Cannot be parsed correctly. It should be in MM/DD/YYYY HH:MM AM_PM format


Scenario

As I utilized ant to build program, it throwed exception as bellows:
D:\ptc\Windchill_8.0\customization\wtinstaller.xml:234: Date of 05/28/2006 07:06 午後 Cannot be parsed correctly. It should be in MM/DD/YYYY HH:MM AM_PM format.

About the timestamp in the build script is written as bellows:
<tstamp><format property="myDateTime" pattern="MM/dd/yyyy hh:mm aa"
offset="-${sinceDays}" unit="day" /></tstamp>

Solution
Owing to the locale of my environment is Japane, so it will show this kind of error message, we just need to add locale attribute to this element, and set it to be en, then we can resolve this kind of problem.
<tstamp><format property="myDateTime" pattern="MM/dd/yyyy hh:mm aa"
offset="-${sinceDays}" unit="day" locale="en"/></tstamp>

No comments: