This article is an introduction to CreateTime developed by WeChat. The following is the code. Let me share with you
Createtime in WeChat is expressed as the number of seconds between 0:00:00 on January 1, 1970 and the time when the message was created. There are two ways to obtain Createtime:
long createtime = System.currentTimeMillis(); long createtime = new java.util.Date().getTime();
The way to convert createtime to the current time is:
long msgCreatetime = Long.pareseLong(createtime)*1000L; DateFormate format= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = format.format(new Date(msgCreatetime));
[Related recommendations]
1. WeChat public account platform source code download
2. WeChat public account development--analysis of CreateTime
3. WeChat payment for WeChat development
The above is the detailed content of Introduction to WeChat developmentCreateTime. For more information, please follow other related articles on the PHP Chinese website!