Java中特定于语言环境的上午/下午指示器
特定于语言环境的上午/下午指示器是AM/PM标记指示器。
使用“p”转换字符显示AM/PM。
System.out.printf("Morning/afternoon indicator: %tp",d);示例
import java.util.Date;
public class Demo {
public static void main(String[] args) {
Date d = new Date();
System.out.printf("Morning/afternoon indicator: %tp",d);
System.out.printf("\nMorning/afternoon indicator: %Tp",d);
}
}输出结果
Morning/afternoon indicator: pm Morning/afternoon indicator: PM
热门推荐
10 祝福语生日男朋友简短
11 高温早安祝福语简短精辟
12 生日油画棒祝福语简短
13 省运会童声祝福语大全简短
14 结婚婚庆祝福语简短
15 妈妈生日祝福语简短温暖
16 双十一祝福语大全简短
17 五二零朋友祝福语大全简短
18 给医生简短新年祝福语