timezone

PHP Offsetting unix timestamp

可紊 提交于 2019-12-11 02:25:12
问题 I have a unix timestamp in PHP : $timestamp = 1346300336; Then I have an offset for timezones which I want to apply. Basically, I want to apply the offset and return a new unix timestamp. The offset follows this format, and unfortunately can't be changed due to compatibility with other code: $offset_example_1 = "-07:00"; $offset_example_2 = "+00:00"; $offset_example_3 = "+07:00"; I tried: $new_timestamp = strtotime($timestamp . " " . $offset_example_1); But this does not work unfortunately :(

PostgreSQL 9.1 timezones

风格不统一 提交于 2019-12-11 02:24:04
问题 I'm using postgresql to store some dates on a database. In my application it is fundamental that it is completely aware of timezones and I was conducting some basic tests, between, client, server and database. I'm sending the dates from a browser's application I did in GWT and read the dates on postgresql. My tests: The client is always in GMT Timezone, and I'm sending always the same date for each case. 13/04/2012 00:00:00 GMT+00 On posgres I'm changing timezones for each test. Between tests

PHP DateTime Timedifference only correct in UTC Timezone?

核能气质少年 提交于 2019-12-11 02:23:40
问题 Can anybody explain me following behaviours: $end = new DateTime("2015-03-01", new DateTimeZone("Europe/Berlin")); $start = new DateTime("2015-02-01", new DateTimeZone("Europe/Berlin")); $diff = $start->diff($end); //result: DateInterval Object ( [y] => 0 [m] => 0 [d] => 28 [h] => 0 [i] => 0 [s] => 0 [invert] => 0 [days] => 28 ) If I don't use a timezone or Europe/Berlin I get wrong time diffs. 28 days is indeed correct, but in this case it's a month. $end = new DateTime("2015-03-01", new

Do filesystems store time zone information?

孤者浪人 提交于 2019-12-11 02:22:40
问题 Do filesystems store time zone information along with the file information? I ran into a weird bug where I do the following snippet and I get different time zone printed out. import DateTime #zope's module for each in os.listdir("director"): print DateTime.DateTime(os.stat(each)[8]) #Why is it mixed up? Foo 12:00:00 US/Eastern Bar 12:00:00 GMT -4 It started to happen after Daylight Saving changes were made. I see Eastern and GMT -4 both. IIRC Linux doesn't store the time stamp information,

getting the current time at specific timezone

只谈情不闲聊 提交于 2019-12-11 02:18:51
问题 I've a data frame with date and time format of different time zones, I want to compare this with the current time at that timezone. so I want to add 1 hr to the below "Date and time column and then compare that with the current time in that time zone like for the first one (timezone is EDT and the current time is 2017-07-18 10:20 in EDT) Date and time TZ 2017-07-08 16:00 EDT 2017-07-17 15:30 PDT 2017-07-17 11:00 EDT 2017-07-17 20:00 EDT 2017-07-17 10:00 EDT 2017-07-13 15:00 PDT where EDT is

Timezone display value with GMT offset from a given timezone?

冷暖自知 提交于 2019-12-11 02:16:47
问题 I would like to construct a timezone list to show it to users to select. The display name has to be like: ( GMT 5:30 ) India Standard Time(Asia/Calcutta) I am taking all timezones with TimeZone.getAvailableIDs() and constructing the list. The code I wrote is: String[] timeZones = TimeZone.getAvailableIDs(); List<String> tzList = new ArrayList<String>(); for (String timeZone : timeZones) { TimeZone tz = TimeZone.getTimeZone(timeZone); StringBuilder timeZoneStr = new StringBuilder();

Oozie TimeZone handling for Daylight saving (CRON Expressions)

冷暖自知 提交于 2019-12-11 02:09:16
问题 I have a Oozie application that suppose to respect Daylight savings. However my schedules are complex so I can't represent them as Expression Language functions such as ${coord:days(2)} . Therefore I need to use CRON expressions. One example of schedule is every week on weekdays at 13:30 PM (resulting cron expression for Oozie "30 13 * * 2-6" with no time zone adjustment) America/Los Angeles timezone. I want this schedule to works fine regardless of the DST changes. If I schedule this

java: how to get Timezone abbreviation (from offset)?

只愿长相守 提交于 2019-12-11 02:07:12
问题 My code like belows, I am using android. I found different devices may have different result. Using different phone: I can get : "EST" or "GMT-05:00". However, I just want to get abbreviation(just like "EST"). How can I get the abbreviation (or change offset to abbreviation)? String timezone =Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT); 回答1: If anyone else need the solution : I just tweak the code and get desired short name, which i needed to display to user.

Javascript ASP.net date format without timezone info - timezone offsets

≯℡__Kan透↙ 提交于 2019-12-11 02:05:42
问题 I have a client side JavaScript that generates a date in JavaScript( new Date(2007,5,1) ). I need this date passed through to a hidden field that the code behind can access. My issue is that when the hidden field is converted into a DotNet datetime, the time is incorrect. This is because the JavaScript is including timezone info from the client browser. DotNet is then using this info to recalculate the time based on the difference between the server time and the client time. What i need from

Timezone lookup

混江龙づ霸主 提交于 2019-12-11 01:59:21
问题 I have a file that contains the following in a csv file; country,region,city,postalCode,metroCode,areaCode I need to find the time zone for the entries. I have seen olson database and geonames, i was lost with olson database. couldnt find anything useful. is there any web site i can access the time zone information based on country, region, city? Thanks. 回答1: I was able to query this. http://www.earthtools.org/webservices.htm 回答2: Did you have a look at this here...the timezone database is in