开发者

Convert a user inputted time to UNIX Time? [Android]

开发者 https://www.devze.com 2023-04-02 01:23 出处:网络
How would I convert a user given time, using the time picker would be fine, into UNIX time assumin开发者_如何学运维g the user inputted a time in the same time zone that they are currently in?You shoul

How would I convert a user given time, using the time picker would be fine, into UNIX time assumin开发者_如何学运维g the user inputted a time in the same time zone that they are currently in?


You should use Calendar to convert values provided by the user to valid Unix timestamps

Calendar cal = Calendar.getInstance();
cal.set(2011, 9, 3);
cal.getTimeInMillis();
0

精彩评论

暂无评论...
验证码 换一张
取 消