Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#185 Support custom locale and/or patterns for datetime functions

open
nobody
Functions (11)
5
2014-08-07
2010-03-31
Charles Chan
No

Currently, NAnt's datetime functions typically uses invariant culture to format the output. This leads to problems for some users because they cannot specific a specific date time pattern.

The proper fix is to allow an IFormatProvider (ie DatetimeFormatInfo) to be passed as an (optional) argument to the NAnt DateTime functions. Similar to DateTime.ToString(IFormatProvider) in the .NET Framework SDK:
http://msdn.microsoft.com/en-us/library/ht77y576.aspx

Similar functionality is found in Ant's TStamp Task, which supports both locale and pattern.
http://ant.apache.org/manual/CoreTasks/tstamp.html

Original posts:
https://sourceforge.net/mailarchive/forum.php?thread_name=f8a1af311003282001n561aba30uea07c29a1b73b493%40mail.gmail.com&forum_name=nant-users
https://sourceforge.net/mailarchive/forum.php?thread_name=628606.38828.qm%40web112713.mail.gq1.yahoo.com&forum_name=nant-users

Discussion