请使用System.currentTimeMillis()代替new Date().getTime()
时间: 2023-10-25 16:26:59 浏览: 150
获取系统当前时间日期
建议使用System.currentTimeMillis()代替new Date().getTime()来获取时间戳。 这是因为System.currentTimeMillis()方法可以更精确地获取当前的毫秒数。 当你只需要获取一个时间戳时,使用System.currentTimeMillis()可以更加简洁和高效。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [使用 System.currentTimeMillis() 代替 new Date().getTime() 获取时间戳](https://blog.csdn.net/z55947810/article/details/124403743)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [System.currentTimeMillis()](https://blog.csdn.net/libusi001/article/details/103010246)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文