timezone

Improving a function to get stock news data from google in R

时光怂恿深爱的人放手 提交于 2019-12-20 09:24:32
问题 I've written a function to grab and parse news data from Google for a given stock symbol, but I'm sure there are ways it could be improved. For starters, my function returns an object in the GMT timezone, rather than the user's current timezone, and it fails if passed a number greater than 299 (probably because google only returns 300 stories per stock). This is somewhat in response to my own question on stack overflow, and relies heavily on this blog post. tl;dr: how can I improve this

How are major sites detecting timezone? [duplicate]

限于喜欢 提交于 2019-12-20 09:18:16
问题 This question already has answers here : Determine a user's timezone (24 answers) Closed 6 years ago . Facebook, myspace, MSN, craigslist; all detect timezone and show times and dates correctly without ever submitting a form or reloading a page. How do they do it? I have a pretty large site and have people publishing articles which need to display correct times (uploaded 3pm or 6pm depending on timezone). Preloaders? Javascript? Loading the page and reloading it? My site currently has the

PostgreSQL date() with timezone

喜你入骨 提交于 2019-12-20 08:39:56
问题 I'm having an issue selecting dates properly from Postgres - they are being stored in UTC, but not converting with the Date() function properly. Converting the timestamp to a date gives me the wrong date if it's past 4pm PST. 2012-06-21 should be 2012-06-20 in this case. The starts_at column datatype is timestamp without time zone . Here are my queries: Without converting to PST timezone: Select starts_at from schedules where id = 40; starts_at --------------------- 2012-06-21 01:00:00

Javascript set timezone in date object itself like setTimeOffset() [duplicate]

試著忘記壹切 提交于 2019-12-20 07:52:05
问题 This question already has answers here : How to initialize a JavaScript Date to a particular time zone (12 answers) Closed 2 years ago . I want to change timezone in Date object itself, because device(web browser?) itself doesn't support timezone. How I change it? For example: var date = new Date(); // Value is "Mon Jun 19 2017 10:00:08 GMT+0000 (GMT)" date.setTimezoneOffset("+09.00"); // For example // Value is "Mon Jun 19 2017 01:00:08 GMT+0900 (GMT)" I don't want to use like this: var date

Run cron job at 12 am in every time zone

半城伤御伤魂 提交于 2019-12-20 07:48:37
问题 So I think there is around 30 minutes between each time zone. I want to run my script cron.php for at 12 am (midnight) for every time zone. How can I do this? I was looking at this code: TZ=UTC * 7 * * * root date | mail root TZ=CEST * 7 * * * root date | mail root TZ=PCT * 7 * * * root date | mail root Does this work? What does any of the code mean? Any better solution? 回答1: Most time zones are 1 hour apart, with a couple of exceptions. The above code will run at 7 AM in each of the time

C++ timegm conversion DST to a certain timezone at a given time in the future?

余生长醉 提交于 2019-12-20 07:34:45
问题 I need an accurate conversion in my class from UTC time to local time of a given timezone, with or without DST in effect. My problem is, that when I use struct tm I have to provide the tm_isdst member, or leave it -1 to be determined automatically. from mktime(3) - linux man page: "The value specified in the tm_isdst field informs mktime() whether or not daylight saving time (DST) is in effect for the time supplied in the tm structure: a positive value means DST is in effect; zero means that

C++ timegm conversion DST to a certain timezone at a given time in the future?

China☆狼群 提交于 2019-12-20 07:34:20
问题 I need an accurate conversion in my class from UTC time to local time of a given timezone, with or without DST in effect. My problem is, that when I use struct tm I have to provide the tm_isdst member, or leave it -1 to be determined automatically. from mktime(3) - linux man page: "The value specified in the tm_isdst field informs mktime() whether or not daylight saving time (DST) is in effect for the time supplied in the tm structure: a positive value means DST is in effect; zero means that

Setting PHP's default timezone

笑着哭i 提交于 2019-12-20 06:31:08
问题 In my web app, I let the users choose their preferred timezone from a list (that contains all timezones that PHP supports). Let's say that $_POST['timezone'] is the chosen timezone ( e.g. America/New_York ). I set it with the following code which produces no errors: default_date_timezone_set($_POST['timezone']); But when I reload the page it goes back to what it was before ( e.g. Europe/Moscow ). Do I have to set the default timezone in every script or isn't the function ( default_date

TimeZone list understanding

╄→尐↘猪︶ㄣ 提交于 2019-12-20 06:29:34
问题 Currently i have a list of timezone fetched from php $tzlist = DateTimeZone::listIdentifiers(DateTimeZone::ALL); which contain 400+ timezone is there any way i can use these timezone list instead of that huge list. 回答1: What we do is pick a "representative" timezone for each of the timezones we want to show. So, our drop-down looks something like this: <select> <option value="America/New_York">US Eastern Time</option> <option value="America/Los_Angeles">US Pacific Time</option> <option value=

W. Aus Standard Time .Net TimeZoneInfo SupportsDaylightSavingsTime Issue

陌路散爱 提交于 2019-12-20 06:13:26
问题 The .Net / Windows TimeZoneInfo object for W. Aus Standard Time shows that it supports daylight savings time. A search on the Australian government site regarding territories' observance of daylight savings shows Western Australia repealed it in 2009, so no daylight savings from 2010 to present and beyond. I have checked the TimeZoneInfo object on several systems, and they all say W Aus Standard Time supports dst. All their registries have the same value. I have checked Windows Updates and