timezone

Converting to Local Time in R - Vector of Timezones

霸气de小男生 提交于 2019-12-30 10:06:55
问题 I have a set of data from across the US that I am trying to convert into local time for each "subject". I have UTC timestamps on each event and have converted those into POSIXct format, but every time I try to include a vector of tz = DS$Factor or tz = as.character(DS$Factor) in any of the POSIXct/POSIXlt functions (including format() and strftime() ) I get an error that says: Error in as.POSIXlt.POSIXct(x, tz = tz) : invalid 'tz' value If I just enter tz = 'US/Eastern' it works fine, but of

“phpinfo(): It is not safe to rely on the system's timezone settings…” [duplicate]

安稳与你 提交于 2019-12-30 08:32:14
问题 This question already has answers here : “date(): It is not safe to rely on the system's timezone settings…” (22 answers) Closed 3 years ago . While running a php installation script for Blue.box (front end to FreeSwitch PBX), I get this error about a timezone failure. Then I start digging. I'm not sure what is going on at this point. But here is what I have: I created an info.php file in my public_html directory that contains a single line: And I get this error and output Warning: phpinfo():

TimeZoneCode to TimeZoneInfo

雨燕双飞 提交于 2019-12-30 07:43:29
问题 In our MS dynamics CRM project we created a mass-user upload batch. The batch reads from an excel file and does a mass upload of the users. One of the things this batch needs to set is the timezonecode. In the excel file the timezone will be written as eg "UTC+1" The code used by CRM seems to be the timezonecode SQL-server is using as can be found here. What is the cleanest way of mapping these? My ideas so far: Hardcode a conversion store Fetch the codes from CRM somehow Fetch the codes from

convert to UTC without changing php timezone settings

僤鯓⒐⒋嵵緔 提交于 2019-12-30 06:56:25
问题 How can I convert the time zone of a date string in php without changing the default time zone. I want to convert it locally to display only. The php time zone settting should not be modified. EDIT: My source time is a UTC string, I want to convert it to a different format, retaining the time zone as UTC, but php is converting it to local timezone. The code I used was: date('Y-m-d H:i::s',strtotime($time_str)); How do I retain timezone? 回答1: $src_tz = new DateTimeZone('America/Chicago');

convert to UTC without changing php timezone settings

一笑奈何 提交于 2019-12-30 06:56:15
问题 How can I convert the time zone of a date string in php without changing the default time zone. I want to convert it locally to display only. The php time zone settting should not be modified. EDIT: My source time is a UTC string, I want to convert it to a different format, retaining the time zone as UTC, but php is converting it to local timezone. The code I used was: date('Y-m-d H:i::s',strtotime($time_str)); How do I retain timezone? 回答1: $src_tz = new DateTimeZone('America/Chicago');

How can I convert windows timezones to timezones pytz understands?

痴心易碎 提交于 2019-12-30 06:15:10
问题 In a windows python environment I can get the local timezone like this, but it's not usable with pytz: >>> import win32timezone >>> win32timezone.TimeZoneInfo.local() TimeZoneInfo(u'US Mountain Standard Time', True) >>> win32timezone.TimeZoneInfo.local().timeZoneName u'US Mountain Standard Time' >>> tz = pytz.timezone(win32timezone.TimeZoneInfo.local().timeZoneName) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pytz\__init__.py",

Why is Safari confused about Date.getDay() for DST start in Sydney, Aus time zone?

六眼飞鱼酱① 提交于 2019-12-30 05:46:05
问题 Safari on OSX believes that October 6th, 2013 is a Saturday in Australia. It's not, it's actually a Sunday. To replicate this issue, just set your time zone to Sydney-Australia, pop open the dev console in Safari, and enter new Date("2013/10/06"). You'll get this: Now change to Seattle-US and you'll get this: The problem also occurs for Melbourne-Australia but not for cities further north such as Brisbane (which fits the zoning for Australian DST), or a handful of other cities I've tested

iOS - Converting time and date to user time zone

≡放荡痞女 提交于 2019-12-30 05:23:05
问题 I am sending some requests on a webserver that replies me time and date like this: "at 18:58 of 05/08/2012" I can figure out how to get the time and the date in 2 NSStrings(18:58, 05/08/2012). Note that the server's time zone is +00:00. What I want to accomplish is to present this time based on user's location. So for example if the reply from server is 23:30 at 05/08/2012 and the user's time zone is +2:00 I want to present him 1:30 at 06/08/2012. Any ideas? 回答1: You should do it the

How common are TIMESTAMPS over DATETIME fields?

孤人 提交于 2019-12-30 05:14:05
问题 I want my product, like every other web product out there, to pull a data information from my database and convert it to the user's timezone before displaying it on a page. I am using PHP and MySQL. Is the use of TIMESTAMP fields more common than the use of DATETIME fields? From my research, it seems that using DATETIME fields, I would have to Store all date information in UTC call date_default_timezone_set('UTC') each time the application starts manually subtract the user's UTC offset hours

algorithm for getting time zone from geo coordinates

旧巷老猫 提交于 2019-12-30 04:23:05
问题 I want to write app where user can point any place on map (not only cities) and get timezone in that place. What data structure (app will not have Internet connectivity) and algorithm should I use? Where I can obtain needed data (I wont more accuracy then divining map into 24 rectangles)? I will write my app in Java ME. 回答1: Given that time zones are based on political entities rather than simply a physical lat/lon computation, I would create a data structure that mapped polygons over lat/lon