What is a browser's local timezone? - dart

I am using the Timezone package to create a SelectOption of available timezones in browser. The user can then select which timezone he would like any time to be display. I would like the selected option in the list to be his local time zone.
The documentation for the package indicates that variable 'local' should be the local timezone - however it always default to UTC. How can I get to be equal to the local time zone?
await initializeTimeZone();
print( local.name);
https://www.dartdocs.org/documentation/timezone/0.4.3/timezone/timezone-library.html

I haven't tried myself but it looks like the intl package might provide what you want:
import "package:intl/intl_browser.dart";
...
String locale = await findSystemLocale();

Related

LaTeX IEEEtran-de: Add URL access date

I'm using the IEEEtran-de package and need to add the term
Zugriff am: DD. MM YYYY
(URL access date) behind the URL. I tried to look up the IEEEtran-de.bst code and search for the relevant lines, but I'm pretty overstrained ...
Is someone familiar with this package and can help me out?

Why does the '.ics/vcs' file cannot open with office365, if TZID parameter present

In my application I am sending mail to various users.The mail is attached with an .ics file. But when the user tries to open the file in Office365 an error pop ups which says
'The .ICS attachment can't be viewed because the format is not supported'.
Please see below the .ics file I have used
BEGIN:VEVENT
DTSTAMP:20170322T064351Z
DTSTART;TZID=America/Denver:20170323T110000
DTEND;TZID=America/Denver:20170323T113000
SUMMARY:WAND: Test Summary
TZID:America/Denver
LOCATION:
UID:20170322T064351Z-1#fe80:0:0:0:0:100:7f:fffe%12
DESCRIPTION:Candidate Name: Test User\nContact Phone Number: 1256355
END:VEVENT
END:VCALENDAR
The issue occurs when I have added the Timezone parameter recently.But this will work if I remove the Timezone parameter.
That is, if I replace
DTSTART;TZID=America/Denver:20170323T110000
DTEND;TZID=America/Denver:20170323T113000
with the below one
DTSTART:20170323T110000
DTEND:20170323T113000
the issue does not occur. But I need to add timezone.
Any additional elements need to add for the timezone parameter?
Please suggest.
The ics stream shown in your example seems to be truncated (missing at least the BEGIN:VCALENDAR) but assuming it is there in your actual ics, you are also supposed to include a VTIMEZONE component (before the BEGIN:VEVENT) that corresponds to the TZID=America/Denver used in your DTSTART/DTEND.
See for example the second example at https://www.rfc-editor.org/rfc/rfc5545#section-4

ics file DTEND time or timezone

When I open my ics file on an android device, the DTSTART date is showing the right time, but the DTENDis showing the wrong time (+1 hour). When I open the ics directly on google calendar or outlook the DTEND date is correctly shown. Why doesn't this work??
BEGIN:VCALENDAR
VERSION:1.0
PRODID:TEST
METHOD:REQUEST
BEGIN:VEVENT
UID: 20150217T011243-1175262756
DTSTAMP: 20150217T011243
DTSTART;TZID=Europe/Amsterdam:20150301T120000
DTEND;TZID=Europe/Amsterdam:20150301T200000
SUMMARY:Werken
END:VEVENT
END:VCALENDAR
N.B. If I remove the TZID from DTSTART and DTEND both start and endtime will show +1 hour.
Most likely this is because your calendar does not define a VTIMEZONE (https://www.rfc-editor.org/rfc/rfc5545#section-3.6.5)

What is Intl library in Dart for?

I read API documents of intl library, but I realy don't have any idea what Intl class helps us.
At first, I have been thinking that the library is like ResourceBundle class in Java.
But now, I can't say for sure...
When should I use intl library?
or Are there any good samples about the library?
Take a look at the intl example in the source code.
From the example comments:
This defines messages for an English locale directly in the program
and has separate libraries that define German and Thai messages
that say more or less the same thing, and prints the message with
the date and time in it formatted appropriately for the locale.
The German file defines a runAt message, which takes two args: time and day
runAt(time, day) =>
Intl.message('Ausgedruckt am $time am $day.', name: 'runAt', args: [time, day]);
The basic_example.dart defines the default, English version
runAt(time, date) =>
Intl.message('Ran at $time on $day', name: 'runAt', args: [time, day]);
You can then use the correct locale:
var de = new Intl('de_DE');
Intl.withLocale(de.locale, () => runAt('10:00', 'Dienstag')).then(print);
// default (en_GB?) locale
Intl.withLocale(new Intl().locale, () => runAt('10:00', 'Tuesday')).then(print);
(print is the default print() function to output the message).

PHP timezone not set

First of all, i don't have access to the php.ini in the webserver.
In my local server I put date.timezone = "Europe/Lisbon" in my php.ini.
Is it possible to change this in .htaccess? or, what is the alternative?
At the moment I get this error in web server for phpmailer():
Strict Standards: date(): It is not safe to rely on the system's timezone settings. ....
On second thought, ini_set may not be the best way to go. Apparently E_STRICT standards say that you should use date_default_timezone_set instead.
Try something like:
date_default_timezone_set('Europe/Lisbon');
$tz = date_default_timezone_get();
More info can be found here about the issue:
http://answers.google.com/answers/threadview/id/739376.html
And here for the default_timezone functions:
http://us2.php.net/manual/en/function.date-default-timezone-set.php
Edit: I found this little gem while I was browsing github.
// has to be set to reach E_STRICT compatibility, does not affect system/app settings
date_default_timezone_set(date_default_timezone_get());
This seems like the best solution.
Try ini_set at the top of your script.
ini_set("date.timezone", "Europe/Lisbon");
Your problem is not difficult. You can change date.timezone in the php.ini and delete => ; <= is the comment in the php.ini
for example
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone =Europe/Paris
http://www.commentcamarche.net/forum/affich-14406518-probleme-avec-l-heure-en-php

Resources