2021-10-15 2537点热度 0人点赞 1条评论

希望格式化当前的时间为:2021年10月14日 下午 1时30分

SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 a hh时mm分");
System.out.println(sdf.format(new Date()));
// 打印出来可能是 2021年10月14日 PM 01时30分
// 也可能是 2021年10月14日 下午 01时30分



SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 a hh时mm分", Locale.CHINESE);
System.out.println(sdf.format(new Date()));

// 打印出一定是上午/下午了 2021年10月14日 下午 01时30分





  • Ranker SEO


    Greetings from Ranker SEO.

    Are you looking for a genuine SEO service to rank your website top on Google? Are you cheated by fake SEO companies?

    You have found an affordable legitimate SEO agency to rank your website.

    We have ranked 100s of websites such as blogs, shopify stores, ecommerce websites, adult websites, saas websites, etc. You can reach more customers by utilizing our backlinks.

    For real proof, you can visit our website and check out. Contact us for more details.

    Our Skype ID: [email protected]
    Our Website: https://www.ranker.one

    Thanks & Regards
    Ranker SEO

    If you don't like to receive our messages, you can unsubscribe by click here https://www.ranker.one/unsubscribe/?site=terrynow.com

  • 您需要 登录 之后才可以评论