Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 Date 对象保存到 Java ME 中的 RMS 中。我想这样做的方法是首先将日期转换为 RMS 可以保存的某个字符串/整数/任何原始数据类型值。然后我想读回这些数据并从中创建一个 Date 对象。那么我该怎么做呢?
您可以使用Date.getTime(),它返回一个long. 您可以使用new Date(long)构造函数来反转该过程。
Date.getTime()
long
new Date(long)