Java中一些获取当前日期的方法 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-14
. The application specifies "%y" if the format pattern is not combined with other format patterns.
yy
The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyy
The year in three digits. If the year is less than 100, the year is displayed with a leading zero.
yyyy
The year in four or five digits (depending on the calendar used), including the century. Pads with leading zeros to get four digits. Thai Buddhist and Korean calendars have five- digit years. Users selecting the "yyyy" pattern see all five digits without leading zeros for calendars that have five digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected.
yyyyy
The year in five digits. Pads with leading zeros to get five digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected.
yyyyyy
The year in six digits. Pads with leading zeros to get six digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected. The pattern can be continued with a longer string of "y"s padding with more leading zeros.
z, %z
The time zone offset ("+" or "-" followed by the hour only). Single-digit hours do not have a leading zero. For example, Pacific Standard Time is "-8". The application specifies "%z" if the format pattern is not combined with other format patterns.
zz
The time zone offset ("+" or "-" followed by the hour only). Single-digit hours have a leading zero. For example, Pacific Standard Time is "-08".
zzz
The full time zone offset ("+" or "-" followed by the hour and minutes). Single-digit hours and minutes have leading zeros. For example, Pacific Standard Time is "-08:00".
:
The default time separator defined in TimeSeparator.
/
The default date separator defined in DateSeparator.
% c
Where c is a format pattern if used alone. To use format pattern "d", "f", "F", "h", "m", "s", "t", "y", "z", "H", or "M" by itself, the application specifies "%d", "%f", "%F", "%h", "%m", "%s", "%t", "%y", "%z", "%H", or "%M".
The "%" character can be omitted if the format pattern is combined with literal characters or other format patterns.
\c
Where c is any character. Displays the character literally. To display the backslash character, the application should use "\\".
Java中一些获取当前日期的方法(5)时间:2011-10-07 javaeye RednaxelaFXC#另外有DateTime.UtcNow,用于获取当前的UTC时间。 虽然是用C#来说,其它在.NET Framework上运行的程序语言当然也能用同样的类库,例如说C++/CLI、 VB.NET、JScript.NET等,不重复记录了。 JavaScript: Js代码
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Java中一些获取当前日期的方法 - 编程入门网的所有评论