![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
时间转换
时光伤了流年@you
这个作者很懒,什么都没留下…
展开
-
Java中如何获取某一天是周几
/** * 获取指定年月的第一天 * * @param day * @return */ public static String getFirstDayOfMonth(String day) { int year = Integer.parseInt(day.substring(0, 4)); int month = Integer.parseInt(day.substring(4, day.length())...原创 2021-05-11 17:41:29 · 420 阅读 · 0 评论 -
Java中如何获取日历显示的日期呢
/** * * @param day 每个月的第一天或者最后一天 * @param dayCount dayCount 要加减的日期 * @param type type类型 (0 月初1 月末) * @return */ public static String getCalendar(Integer day, Integer dayCount, String type) { Calendar cl = Calendar.原创 2021-05-11 17:34:41 · 242 阅读 · 0 评论 -
java中如何将2021-04-05T13:08:22+08:00转成date呢
java中如何将2021-04-05T13:08:22+08:00转成date呢 public static Date dealDateFormat(String oldDateStr) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); try { Date date = df.parse(oldDateStr); return date;原创 2021-04-14 17:46:43 · 7263 阅读 · 2 评论 -
java中如何把2021-04-05T11:22:23.349+08:00转成Date呢
java中如何把2021-04-05T11:22:23.349+08:00转成Date呢public static Date dealDateFormat(String oldDateStr) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); try { Date date = df.parse(oldDateStr); return date; }原创 2021-04-14 16:46:40 · 5216 阅读 · 2 评论 -
java中Mar.02.2021 2:52 PM 转date
public static Date parseDate(String date) { SimpleDateFormat sdf = new SimpleDateFormat("MMM.dd.yyyy h:m a", Locale.ENGLISH); try { Date d2 = sdf.parse(date); return d2; } catch (ParseException e) { e.printStackTrace();原创 2021-04-02 11:29:24 · 520 阅读 · 0 评论 -
java中MM/DD/yy, HH:mm AM 转成时间戳
public static long dateToMs(String _date) { SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy, hh:mm aa", Locale.ENGLISH); try { Date date = format.parse(_date); return date.getTime(); } catch (Exception e) { retu原创 2021-04-02 11:19:54 · 628 阅读 · 0 评论