【问题标题】:Extract UTC time and convert it to Unix time format提取 UTC 时间并将其转换为 Unix 时间格式
【发布时间】:2012-11-09 10:50:36
【问题描述】:

我有两个问题:

1- 从 Android 设备获取 UTC 时间 2- 将其转换为 UNIX 时间格式(毫秒)

感谢任何可以提供帮助的反馈

【问题讨论】:

  • java 101 : System.currentTimeMillis()

标签: android datetime time formatting utc


【解决方案1】:

我相信这应该可行:

Date now = Calendar.getInstance().getTime(); // this gets you current time as a Date
long milis = now.getTime(); // this gets you current time in UNIX format

【讨论】:

    猜你喜欢
    • 2011-05-29
    • 2017-12-17
    • 2014-05-06
    • 1970-01-01
    • 1970-01-01
    • 2016-06-11
    • 1970-01-01
    • 1970-01-01
    • 2014-09-02
    相关资源
    最近更新 更多