Home >WeChat Applet >WeChat Development >Introduction to WeChat developmentCreateTime

Introduction to WeChat developmentCreateTime

零下一度
零下一度Original
2017-05-27 13:44:043906browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn