The %1$tB formatting string in the code above tells the program to use the first argument and print out the full month name for the date object.
上面代码中的格式化字符串 %1$tB 告诉程序使用第一个参数并打印 date 对象的完整月名。
Note: the date object will automatically hold the current date and time as its initial value!
注意:时间对象将自动把当前的日期和时间作为初始值!
And this example is similar to the preceding one except that this time I pass the Date object directly to the constructor.
并且这个例子与前例类似,唯一不同之处是我在这里将Date对象直接传递给构造函数。
应用推荐