简体   繁体   English

在“应用购买响应”中,哪个购买时间将该时间戳值转换为日期格式?

[英]In App purchase response which purchase time, convert this timestamp value to date format?

In-App purchase response, as purchase time, how to convert this timestamp to date format, the problem I am facing is the value of timestamp is exceeding long data type limit? 应用内购买响应,作为购买时间,如何将此时间戳转换为日期格式,我面临的问题是时间戳的值超过了长数据类型限制? kindly explain how to finad the date from timestamp in this case? 请解释在这种情况下如何从时间戳确定日期?

You are trying to parse a timestamp with SimpleDateFormat using an incorrect format string "MMddyyHHmmss". 您正在尝试使用不正确的格式字符串“ MMddyyHHmmss”来解析带有SimpleDateFormat的时间戳。 The timestamp value returned is expressed in "milliseconds since the epoch (Jan 1, 1970)". 返回的时间戳值以“自纪元(1970年1月1日)以来的毫秒数”表示。 Parse the string to its long value and create a Date object directly from that: 将字符串解析为其长值,然后直接从中创建一个Date对象:

Date date = new Date(Long.parseLong(timestampString)); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM