Universal cross-platform syntax URL parameters directions travel type transit departure time - directions

My app is using the universal maps URL to open a local transit route map.
I have no problem getting the map I want using something like:
https://www.google.com/maps/dir/?api=1&origin=42.352312,-122.869691&destination=42.324418,-122.871534&travelmode=transit
I would like to add departure time to the url, but having no luck getting the map to show the route for the requested departure.
From what I can gather, the departure time parameter is 'departure_time', and the value is in Julian seconds.
I was hoping the following URL would give me the route that departed around 9:30am PST June 6 2018:
https://www.google.com/maps/dir/?api=1&origin=42.352312,-122.869691&destination=42.324418,-122.871534&travelmode=transit&departure_time=32503647540
But no matter what time I specify, it returns a route at the current time, not the time I requested.
So, what am I doing wrong?
I figure either the parameter name is wrong (I also tried 'departuretime'), or my julian date calculation is wrong, or departure time is not supported.
Anybody?

Related

Google play Developer Api - Voided Purchases

I'm facing an 403 error when using this endpoint: https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list
But the error only occurs when I pass the startTime/endTime param, without this parameter I can access this endpoint correctly.
I'd like to know if somebody else know witch permission is missing.
I already gave to my service account permission in google play developer console related with orders and purchases.
https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.voidedpurchases/list
Is it possible you are making an error in how you’re specifying either of the parameters? What does your request look like?
startTime
string (int64 format)
The time, in milliseconds since the Epoch, of the oldest voided purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.
endTime
string (int64 format)
The time, in milliseconds since the Epoch, of the newest voided purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.
Perhaps you’re specifying a value which is out of the expected range?
At the bottom of the page there is a “Try this api” section so you can try out parameters in their form, so you can see if you’re making some kind of mistake..

How to know if due time is set

It seems google classroom API always returns a dueTime value - and if no time is selected when entering an assignment in classroom, 8:59 is used by default. How do I know if there was no time entered at all, or if 8:59 was really used?
Based from this documentation:
dueTime
description- Represents a time of day. The date and time zone are
either not significant or are specified elsewhere. An API may chose to
allow leap seconds. Related types are google.type.Date and
google.protobuf.Timestamp.,
Note: Optional time of day, in UTC, that submissions for this course work are due.
This must be specified if due_date is specified.

Is it possible to get local time with Google API?

I'm working on an app that it using Google API for maps, but the problem I am having is obtaining correct local time. I can not use JS, because a user can travel to a different location and probably won't change the time settings. Also the server seems to be somewhat off and I have no control over its UNIX time. However, anytime you google for local time, you get based on your location. Since my app is using location as well, shouldn't I be able to access that time as well?
This can be done using Google Timezone API:
1- First use Google Timezone API to obtain the user's time zone info, the api accepts the target time (timestamp) in UTC (as UNIX time in secs) and location data
2- The response contains three important fields:
dstOffset: This is offset for day-light saving (secs)
rawOffset: This is raw offset for given location without day-light saving (secs)
timeZoneId: This is IANA time zone id
Using the first two you can get your date in JS as:
var localDate = new Date((timestamp + dstOffset + rawOffset) * 1000);
or by third one using timezone-js or moment-timezone.
Have a look at this answer for using timezone.

Time object in Ruby

I want to know if Time.localtime returns the user local time or the server local time.
If it is the server, is it any clean way to convert a UTC time or datetime to user local time?
Ruby's Time class knows nothing about any "client". You would have to inspect request headers for that. Time#getutc and Time#getlocal seem to be what you want. Notice the variant on getlocal where you can enter the TZ offset - if you pass it the client's TZ, you can get the client's local time. As I said earlier, you would have to look into the request headers to figure out which TZ it is.
EDIT: Scratch that, apparently there does not have to be a Date header in a request. So you're down to JavaScript to tell you about the time zone.

MS Outlook incorrectly interprets ICS files in local time: daylight savings time overcorrection

Does anyone know a way in an ICS file to specify that all times are written in the local time at the location? I thought that leaving the 'Z' off the end of times, and using the TZID="America/Denver" (for example) in DTSTART and DTEND lines accomplished this, but MS Outlook assumes that all times are in the location's standard time. My events all take daylight savings time into account.
Do I have to rewrite the app so times are in UTC?
Do I have to include a block at the beginning that defines any time zone? This is difficult since I want to support every time zone in the Olson database.
But currently MS Outlook pushes every appointment that's during daylight savings time forward one hour, which is wrong.
Thanks in advance for any help.
I had a very similar problem to this, and I did a lot of research but the solution still isn't the best. I'm not sure why Outlook doesn't handle local times correctly, it makes scheduling local time appointments for other time zones a big hassle. The standard clearly indicates that if no time zone is specified, and the UTC 'Z' character isn't used, then the time should be the same no matter what time zone the receiver is in. However, Outlook doesn't adhere to this, and changes the time depending on the sending client time & receiving client time.
In my case I have a site running which allows certain users to schedule other users for appointments.These users can be located in many different time zones. Luckily for me, the site is specifically hosted in just one time zone. Thus, my solution was to write a simple c# switch statement that offsets the time based on where the receiving user is relative to where the server is. I don't specify a time zone in the .ics file, and I don't mark the time as UTC via the 'Z' character.

Resources