时间格式说明(Google Directions API)

时间格式说明(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.