timezone

Is it possible to change default TimeZone in MongoDB using Rails 3?

孤街浪徒 提交于 2019-12-22 23:20:23
问题 I have such trouble: when I'm creating object and setting some datetime It is saving database in UTC TimeZone. Here is example: //showing full list of object properties Grant _id: 5108ee29e6b564611400000, start_date: 2013-01-30 09:56:27 UTC //then showing a.start_date Wed, 30 Jan 2013 13:56:27 +0400 I tried to forbid database to use UTC. Here is mongoid.yml: development: options: raise_not_found_error: false sessions: default: use_activesupport_time_zone: true use_utc: false database: test

D3 DateTime parser takes into account timezone

眉间皱痕 提交于 2019-12-22 19:36:20
问题 I have this URL and I need to parse and convert the mydate timestamp into a UTC datetime (in Javascript). http://www.blablabla.com/#mydate=2009-10-12T22:09:28.000 Obviously the date encoded in the URL is just string so it doesn't convey any timezone information: however it is meant to represent a UTC time. Converting a UTC timestamp string into a UTC Datetime seems to be quite straightforward however I get this problem: I'm using D3 time parser to do it, here the important bit: var iso = d3

Historical daylight savings in Windows

女生的网名这么多〃 提交于 2019-12-22 12:16:42
问题 Is there a easy way in Windows (using Delphi, not .NET) to convert UTC times to a local time, with daylight saving adjustments. Data goes back 12 years, so needs to take account of changes in DST start/end dates over that time. 回答1: Funny, a very similar question appeared yesterday on LinkedIn. This is the answer I gave there: Time Zones are somewhat fluid, especially when Daylight Saving Time starts/finishes. This database ( http://en.wikipedia.org/wiki/Tz_database ) defines the time zones,

PHP: System Timezone Setting error

狂风中的少年 提交于 2019-12-22 11:29:27
问题 I'm trying to use PHP in the terminal under MAMP but I got an error related to the system's timezone settings. How can I fix this error? $/Applications/MAMP/bin/php5/bin/php echo.php PHP Strict Standards: PHP Startup: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the

Oracle timestamp with local time zone values transparent translation

早过忘川 提交于 2019-12-22 10:54:43
问题 As far as I know, TIMESTAMP WITH LOCAL TIME ZONE values are transparently translated to and from the user's session time zone. But my values read from the database aren't the same as previously inserted. Is there a database or session parameter I can tweak to fix this? Here is my test case: select systimestamp(0) from dual; -- SYSTIMESTAMP 15/03/2017 19:01:13 +03:00 select dbtimezone from dual; -- DBTIMEZONE -07:00 create table test_timestamps ( id number generated by default on null as

MYSQL - Compare NOW() and a date at Paris TimeZone in a request

自古美人都是妖i 提交于 2019-12-22 10:19:25
问题 I have a value stored as a DateTime (Paris date-time). How can I, into a VIEW, know if a stored date is before or equal to NOW(), with NOW() at Paris TimeZone in any case? PS : I do not have any control over the SQL server. 回答1: To Ensure that the date is in paris time zone you can use CONVERT_TZ to convert between time zones. For example the following query will compare the NOW() date with the stored date and gives you the difference (in days) between them, ensuring that the two dates are in

Convert between arbitrary timezones

佐手、 提交于 2019-12-22 09:55:18
问题 I'm trying to find a simple yet robust way to convert time between arbitrary time zones. UPDATE 1: I don't understand why this has been downvoted. I've made my research and explored the possibilities. This problem is not as trivial as it might seem. If you think that the function shall look like bTime = aTime + 3 , then please reconsider. Timezones and DSTs are in a state of constant flux. Read this for reference: list of pending / proposed timezone changes. Note that some countries are

How to convert a datetime from one arbitrary timezone to another arbitrary timezone

孤街醉人 提交于 2019-12-22 09:51:46
问题 Let's say I receive an arbitrary datetime object in a request, like this, which could be coming from any possible timezone - I don't know which one. For the sake of example, pretend it comes from the East Coast import pytz from colander import iso8601 ... ests1 = iso8601.parse_date('2016-04-01T00:00:00.0000-04:00') pretend ests1 is the object that comes in Using pytz, I can find out a bit about it's timezone etz = ests1.timetz() # 00:00:00-04:00 etzi = ests1.tzinfo # <FixedOffset '-04:00'

Is there a way to get locale from country or timezone?

戏子无情 提交于 2019-12-22 09:37:50
问题 I was programming a program in Python, where I need to output date as per user's locale: Get a list of timezones in a country specified as per user input (did that using pytz) Get the locale of the user (which I am unable to figure out how to do) Is there a way to get locale from county/timezone or some other method needs to be followed? Or do I need to get the locale input from user itself? EDIT The program is to be a web-app. The user can provide me his country. But does he have to

Detect if the DST is currently enabled

放肆的年华 提交于 2019-12-22 09:12:17
问题 I need to find an easy way to know if the local machine's 'automatically adjust clock for Daylight Saving Time' option is enabled. If the option's on, I need to know whether it is currently applied (i.e. is it DST currently in the system). Thanks in advance 回答1: You can find the current system default time zone and whether it is currently using DST (Daylight Saving Time) like this (.NET 3.5 onwards): TimeZoneInfo zone = TimeZoneInfo.Local; if (zone.SupportsDaylightSavingTime) { Console