时间格式说明(Google Directions API) [英] Explaination of time format (Google Directions API)

查看:55
本文介绍了时间格式说明(Google Directions API)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读用于提出路线请求的 Google Directions API 文档.一个 URL 的例子被给出为

I have read the documentation of the Google Directions API for making a direction request. An example of a URL is given as

http://maps.googleapis.com/maps/api/directions/json?origin=Brooklyn&destination=Queens&sensor=false&departure_time=1343605500&mode=transit

departure_time 变量的值应该反映以下信息:

The value of the departure_time variable is supposed to reflect the following information:

2012 年 7 月 30 日上午 09:45.

July 30, 2012 at 09:45 am.

谁能解释一下这个时间格式.

Can someone please explain this time format.

谢谢.

推荐答案

这是一个时间戳 - 自 Unix 纪元,1970-01-01 00:00:00 UTC.如果您想要该格式的立即",您可以使用 System.currentTimeMillis()/1000,或者如果您有 Date 对象,可以使用 date.getTime()/1000代码>.

It's a timestamp - seconds elapsed since the Unix epoch, 1970-01-01 00:00:00 UTC. If you want "right now" in that format, you can use System.currentTimeMillis() / 1000, or if you have a Date object, you can use date.getTime() / 1000.

这篇关于时间格式说明(Google Directions API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆