zoukankan      html  css  js  c++  java
  • 用到的一些方法

    public static List<CanBie> allCanbie = new ArrayList();
    

    根据当前的时间与数据库表存储时间来判断餐别

    public static CanBie getCurrentCanbie() {
            long hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
            long minutes = Calendar.getInstance().get(Calendar.MINUTE);
            long seconds = Calendar.getInstance().get(Calendar.SECOND);
            long now = hour * 60 * 60 + minutes * 60 + seconds;
            for (int i = 0; i < allCanbie.size(); i++) {
                CanBie cb = allCanbie.get(i);
                if (now > cb.CB_StartTime && now < cb.CB_EndTime) {
                    return cb;
                }
            }
            return null;
        }
  • 相关阅读:
    19-10-31-B
    19-10-30-Night-V
    19-10-30-C
    19-10-29-Night-X
    19-10-29-Z
    19-10-28-A
    19-10-27-S
    19-10-26-Night-D
    留言板
    优秀博客存档
  • 原文地址:https://www.cnblogs.com/LIANQQ/p/2942795.html
Copyright © 2011-2022 走看看