Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date Acharengine timeseries迄今为止的双值_Date_Double_Converter_Achartengine - Fatal编程技术网

Date Acharengine timeseries迄今为止的双值

Date Acharengine timeseries迄今为止的双值,date,double,converter,achartengine,Date,Double,Converter,Achartengine,我可以将X轴的日期/时间值添加到TimeSeries中,如果使用getPadding,它将返回一个double,那么如何将这个double再次转换为日期 示例返回了双精度值:1.40669949E12。我也尝试从字符串转换,但没有成功 现在,我想将此值转换为格式化日期,是否可能?需要使用Math.round将您得到的值四舍五入为long,然后使用此long,您可以构建一个日期,您可以按需要格式化 String format = "h:mma"; // for example Double d =

我可以将X轴的日期/时间值添加到TimeSeries中,如果使用getPadding,它将返回一个double,那么如何将这个double再次转换为日期

示例返回了双精度值:1.40669949E12。我也尝试从字符串转换,但没有成功


现在,我想将此值转换为格式化日期,是否可能?

需要使用Math.round将您得到的值四舍五入为long,然后使用此long,您可以构建一个日期,您可以按需要格式化

String format = "h:mma"; // for example
Double d = 1.40669949E12;
String formattedStr = new SimpleDateFormat(format).format(new Date(Math.round(d)));