timezone

EDSunriseSet returning 0

别等时光非礼了梦想. 提交于 2019-12-13 02:22:59
问题 I am using the EDSunriseSet class from https://github.com/erndev/EDSunriseSet I have the code: if(longitude == 0 && latitude == 0){ longitude = 51.50722; latitude = -0.12750; } EDSunriseSet *sunrise = [EDSunriseSet sunrisesetWithTimezone:[NSTimeZone localTimeZone] latitude:latitude longitude:longitude]; NSLog(@"With lat = %f and long = %F; sunrise is at: %@",latitude,longitude,sunrise.localSunset); and it returns: <NSDateComponents: 0x10a2743a0> Hour: 0 Minute: 0 Second: 0 Is the issue on my

PHP Echo Timezone based on GMT offset

筅森魡賤 提交于 2019-12-13 02:14:21
问题 I have an application that stores GMT time data in a MySQL db like this: 2009-12-16 15:27:47. The user's timezone offset is stored in another column like this: -6 The above timezone is GMT-6, which is CST. Is there any way I can echo CST (i.e. - date('T")) from the GMT offset data? Note: I should also add that the application global timezone is set using: date_default_timezone_set('GMT'); 回答1: Unfortunately, there isn't always a single timezone for each GMT offset. Many GMT offsets have

Query timezone - db server & client machine have different time zones

余生长醉 提交于 2019-12-13 01:43:18
问题 (This is a follow-up to: Time zone storage in PostgreSQL timestamps) I am using PostgreSQL 9.x, the db server has default timezone as +9 for example, it has a table that contains a column of timezone type. There is a Java program on the same server as the db, it query data from the the database. Both the server that the db resides, and the client (a browser) of the Java server program is in timezone -8 . My questions are: Will the client (brower) show the original datetime or adjusted

What is the local timezone

泪湿孤枕 提交于 2019-12-13 01:15:53
问题 Assuming the server (gae) is on the US west coast (PST), an appointment is in New York City (EST) at 10:00am and a person in Chicago (CST) is using his device to know the time of the appointment in NYC. How can the the person in Chicago's device in CST see that the appointment is at 10am when she goes to the website that resides in EST, and does it matter how the developer, who was in MST, sets up parameters in datetime, time, and calendar using python? Also, what timezone is "local time"

help me understand now() for mysql current time and its time zones

拜拜、爱过 提交于 2019-12-13 00:59:48
问题 I need help understand how mysql can determine what the timezone is when I use the function now() (in mysql) when I insert into mysql database. The datetime format is YYYY-MM-DD 00:00:00. How do you get the user to get the right time at their location? Does this question make sense? Thank you for your time! 回答1: now() is always refer to the server time from its timezone. If you have both server and user timezone, it can be done via function convert_tz, such as set @user_time_zone:='+02:00';

Is timestamp in mysql cached when retrieved in different timezones?

送分小仙女□ 提交于 2019-12-13 00:50:06
问题 In the MySQL 5.6 Manual, it says: MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. but if I have different connections with different timezones, will the timestamp value be cached? 回答1: According to OZ_ here: Another one difference: queries with "native" datetime will not be cached, but queries with timestamp - will be. – OZ_ Apr 28 '11 at 17:37 But I cannot find any confirmation of this by Googling, and

.net - defining TimeZone at application level

倖福魔咒の 提交于 2019-12-13 00:24:31
问题 I have a global application compsed by many sub-applications : Web sites Windows services I want to dispatch those "application part" in many servers. My problem is : I want the dates to be still accurate. If an event is stored at 6:00 PM pacific time, I don't want my european users to see "6:00 PM" on their board. I've read a lot of articles that say "you just have to save your dates that way" => but I can't change the way each single date is saved, that represent too much work (and yes, it

Detect user timezone and display UTC time with that timezone

落爺英雄遲暮 提交于 2019-12-12 23:22:43
问题 I have a table with UTC TIMESTAMPS column. How I display it with user timezone? Facebook uses user computer’s time settings. Facebook has no page for user setting their timezone, so I guest Facebook auto detect it. How I can achieve like Facebook? I'm using php 回答1: You can't reliably do this on the server side. You can instead detect the user's timezone using JavaScript but it may not be totally reliable. http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/ 来源:

How to convert a string containing a EDT related instant to a DateTime?

时光毁灭记忆、已成空白 提交于 2019-12-12 23:05:19
问题 I have a string in this format: "Fri, 18 Mar 2011 18:53:15 EDT" I want to convert this to datetime object, the problem is with EDT, at the end. If I use GMT DateTime.TryParse works fine, but if it is something else like EDT, it return false. 回答1: Check out the TimeZoneInfo class and this question, or the definitive time zone guide. 来源: https://stackoverflow.com/questions/5358774/how-to-convert-a-string-containing-a-edt-related-instant-to-a-datetime

Set the default timezone in symfony

不羁岁月 提交于 2019-12-12 22:16:04
问题 i want to know how can i set timezone for an entire project? i'm using symfony 1.4 with doctrine and i have a problem with datetime saving. whenever i save a record, it's time is not correct and i know that's because of timezone. i know i can use date_default_timezone_set() function to set default timezone, but i have to do it in every single action that i'm using date and it's not right. is there an easier way to do it? i think doctrine should have something to set it automatically but i don