【问题标题】:Inserting current date into mysql database using android studio? [closed]使用android studio将当前日期插入mysql数据库? [关闭]
【发布时间】:2017-07-22 03:03:09
【问题描述】:

我想使用 android studio 将当前日期插入 mysql 数据库。我正在使用 volley 库进行插入。只需要提示,不需要详细说明。谁能帮我? 提前致谢!

【问题讨论】:

标签: java android mysql


【解决方案1】:
> You should try this one for getting current date:




 DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
                    String todate= dateFormat.format(currentdate());

  String  finalto = todate.toString(); //here you get current date
    private Date currentdate() {
            final Calendar cal = Calendar.getInstance();
            cal.add(Calendar.DATE, 0);
            return cal.getTime();
        }

【讨论】:

  • 感谢您的帮助 Harshal Deshmukh。
  • wc先生............
猜你喜欢
  • 2019-10-12
  • 2012-10-18
  • 2015-07-31
  • 2013-11-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多