为什么蚂蚁打印时间以斜线? [英] why ant print time with a slash?

查看:77
本文介绍了为什么蚂蚁打印时间以斜线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的日期格式:

<entry key="buildDate" type="date" value="now" pattern="MM-dd-yyyy HH:mm:ss"/>

蚂蚁给我这个结果(在一个key-value属性文件):

But ant gives me this result (in a key-value properties file):

buildDate=01-13-2012 14\:19\:59

为什么蚂蚁添加这些大幅削减?因为它是一个属性文件?

Why ant add those slash in? because it is in a properties file?

推荐答案

是的。冒号具有特殊含义在Java属性文件(它们可以作为键 - 值分隔符),所以蚂蚁需要与反斜杠转义。

Yes. The colons have special meaning in a Java properties file (they can act as key-value separators), so Ant needs to escape them with backslashes.

这篇关于为什么蚂蚁打印时间以斜线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆