fullcalendar - Set current date based on timezone - timezone

There have been a couple of similar questions in the past, but none I've found have been fully answered so let me try again.
I'm writing this web app where users can select their particular timezone, which might be different from the one set up in their respective system. Say my computer is set to the "America/New_York" timezone. If I (for whatever reason) set up my timezone configuration to "Asia/Tokyo" within the web app, I would like to:
have the current month aligned with the configured timezone ("Asia/Tokyo") and
have the highlighted current date also set to the "Asia/Tokyo" timezone.
I've tried many different configurations without any luck...
$("#calendar").fullCalendar({
defaultView: "month",
timezone: "Asia/Tokyo",
ignoreTimezone: false,
defaultDate: moment("2019-03-10"),
header: {...
In this case, I'm hard coding the defaultDate for tomorrow ("2019-03-10") to see if the current date highlight changes to no avail.
Is there a way to accomplish these two issues?
Update:
Okay, the answer to question (2) I found to be the parameter now. In this case, things would look like...
$("#calendar").fullCalendar({ defaultView: "month", now: moment().tz("Asia/Tokyo"), ...
As explained above, if say, my laptop is said to be configured with the "America/New_York" timezone, but I'm actually in Japan and my web app config reflects that, it won't matter. fullCalendar will now show the correct day for Today.
Still, the question remaining is (1): How to make the (monthly) calendar days be in sync with a given timezone? Thanks!

Related

Ical.Net: Event's AsUtc flag is not updating correctly

I am facing this issue in Ical.Net Version=4.0.1.0 and lower, When we get "GMT-0500" in DTSTART/DTEND then it is giving same utc time as local time in AsUtc. But If I replace "GMT-0500" to "Canada/Eastern" manually in ics its giving correct utc time in AsUtc.
Following is not working fine -:
DTSTART;TZID=GMT-0500:20181213T190000
DTEND;TZID=GMT-0500:20181213T220000
Following works fine -:
DTSTART;TZID=Canada/Eastern:20181213T190000
DTEND;TZID=Canada/Eastern:20181213T220000
GMT-0500 isn't a valid IANA time zone. Here's the list of IANA time zones. You want Etc/GMT+5.
Canada/Eastern is deprecated. I suggest you use America/Toronto instead.
In general, I suggest you familiarize yourself with the actual time zone names instead of guessing as to what they might be, and hoping for the best.
There were also some bugs with caching AsUtc values, as I noted in the release notes. I suggest upgrading to 4.latest. It should be backwards compatible.

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

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.

how I can have two clocks on my page and they will be updating in real time?

I have a weather website and I'm driving me crazy to figure out how I can have two clocks on my page and they will be updating in real time. One with the 'Europe/Lisbon' timezone and the and the other with the 'UTC' timezone
Now I have this code lines:
<strong>Elvas:</strong>
<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('Europe/Lisbon');
// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('H:i');
?>
&nbsp &nbsp
<strong>UTC:</strong>
<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('UTC');
// Prints something like: Monday 8th of August 2005 03:12:46 PM
echo date('H:i');
?>
But of course with no automatic updates as I would like.
Thanks in advance for any posible help you could give to me.
PHP is a server-side technology. If you want to update your page in real-time, you need to stick with JavaScript.
By default, JavaScript doesn't know anything about time zones, other than the time zone of the computer it is running on. In order to display the time in some other time zone, you will need a time zone database for JavaScript. I list several of them here.
For example, you can use moment.js with the moment-timezone add-on. Getting the current time in a specific time zone is like this:
moment().tz('Europe/Lisbon').format('YYYY-MM-DD HH:mm:ss')
To update it periodically, you can use window.setInterval.
If you are looking for a very easy solution already coded for you, consider using the "Free Clocks for Your Website" offered at timeanddate.com. They are very reliable and customizable for different time zones.

How do I set the time zone in Trac?

I am struggling with setting up time zones with Trac. I have searched around but I have found nothing helpful. What can I do?
Both a whole site timezone or a per-user timezone settings would be helpful.
Like indicated by others, the solution is to add this to trac.ini:
[trac]
default_timezone = ...
But the tricky thing is the formatting (see http://trac.edgewall.org/ticket/9581):
you can either use GMT +xx:xx format (simple but not time saving aware)
or enter a timezone name e.g. America/Los_Angeles which requires pytz to be installed - see http://trac.edgewall.org/wiki/PyTz.
Default timezone for whole site is set up in the trac.ini:
[trac]
default_timezone = ...
In user preferences you have date time preferences («base_url»/prefs/datetime), where user can set his own (per user) timezone.
See for example http://trac.edgewall.org/prefs/localization
To set the site default timezone, edit trac.ini with the following syntax:
[trac]
default_timezone = GMT +10:00
or
[trac]
default_timezone = GMT -7:00

Resources