How to get user's time zone in Graph - microsoft-graph-api

Currently, need to get a user's office location and then convert that into a time zone, or is there a way to obtain the user's time zone Graph?

Mailbox settings has a timezone property.
https://graph.microsoft.com/v1.0/me/mailboxsettings

According to your descriptions, I assume you want to get the user's time zone by Graph.
In this document, we can get the user's mailbox Settings. We can use the API like this:
GET /me/mailboxSettings/timeZone
or
GET /users/{id|userPrincipalName}/mailboxSettings/timeZone
It will return the user's mailbox time zone settings. The response like this:
{
"#odata.context": "https://graph.microsoft.com/v1.0/XXX/mailboxSettings/timeZone",
"value": "China Standard Time"
}

Related

Why I'm getting a timezone not on TimeZone.knownTimeZoneIdentifiers on iOS?

I'm sending timezone identifiers to our backend, and I'm facing a problem because sometimes I'm sending deprecated ones.
The problem is that this deprecated timezone is get from the phone system.
For instance, selecting "Washington D.C" on time settings I get "US/Eastern" when I call TimeZone.current.identifier.
Furthermore, if I call TimeZone.knownTimeZoneIdentifiers I get a list of ~400 items, but "US/Eastern" is not there!
How is it even possible that TimeZone.current.identifier is returning a timezone not in knownTimeZoneIdentifiers?

How to create Youtube Live Event with all options

I wrote a .NET program that creates live events in Youtube, but I cannot set the correct starting time and some settings like Keywords, and Region. This is what I do, when I create the Broadcast I put the starting Date and Time this way:
oLiveBroadcast.Snippet.ScheduledStartTime = String.Format(CDate(txtScheduledStart.Text), "yyyy-MM-ddTHH:mm:sszzzz")
...but the GMT is always referred to US (GMT -8). I think that the problem is in the receiving field .Snippet.ScheduledStartTime which has a dateTime format not including GMT. What can I do?
I also didn't find how and whare to set Region (in my case Itali IT-it) and searching Keywords
Thanks

CSOM Sharepoint current user timezone

I need to get the TimeZone and its Bias for the current user in CSOM.
If I read the siteuserinfolist for my current user, I get a TimeZone field with a ushort ID.
is SSOM, I can use SPRegionalSettings with this ID
is CSOM, TimeZoneInfo.GetSystemTimeZones uses a String ID (like the timezone title !)
Any idea how I can get the Bias of the current user in CSOM ?
THANKS !

Grails - Convert Server (UTC Date) to User Date in Controller

I'm trying to convert some dates that I have stored on the server (in UTC). I'd like to convert them to the user's time so it would be pretty for their time zone.
However, I'm not sure about how to go about doing that. What's the best practice to get the user's timezone from the request in the controller?
The timezone is not passed in the request headers. If you had the users time zone stored in a profile setting then you can easily format the date according to this but its not something you can just grab from the request. There are ways to do this in JavaScript.

generating ics file programmatically but never able to produce what timezone invitation was produced

Hi I was trying send meeting invites through my asp.net MVC application. There was a requirement to show which timezone this invite was created as in following image. I tried various things as told by Microsoft support, neither of them worked.
As per Microsoft Exchange Server support's advice I created following.
TZID:Sri Jayawardenepura
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Sri Jayawardenepura:20140416T033000Z
DTSTAMP:20140327T113138Z
DTEND;TZID=Sri Jayawardenepura:20140416T060000Z
LOCATION: Board room
After adding TZID inside DTSTART, it is not coming as invite to gmail.
but following works fine as invitation both in outlook configured with Exchange Server and webmails like gmail.
TZID:Sri Jayawardenepura
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20140318T033000Z
DTSTAMP:20140327T122640Z
DTEND:20140318T060000Z
LOCATION: Board room
however that requirement of showing timezone where invite was created not fulfilled yet.
Can anyone help me. Thanks in advance.
If you look at http://www.kanzaki.com/docs/ical/dateTime.html it states that UTC time is identified by a Z suffix character as well as The TZID property parameter MUST NOT be applied to DATE-TIME properties whose time values are specified in UTC.
I would suspect that if you are using a timezone identifier that you need to remove the Z from the end of the date to get it to work properly.
EDIT: So, I was having troubles with timezones before as well, so I had only used UTC time, however I just got one to work with a timezone, so I hope this helps. Inside VTIMEZONE, you have a STANDARD, but you do not have a DTSTART inside the STANDARD. Again, quoting from the above link, The standard or daylight component MUST include the "DTSTART", "TZOFFSETFROM" and "TZOFFSETTO" properties.
It is not RFC5545 compliant but many calendars will expect a TZID to be compatible with the Olson DB and also may expect to have the calendar property X-WR-TIMEZONE set.
What I have seen is that when doing all of above you increase your calendar compatibility ratio.

Resources