timezone

How to change default time zone in php

大城市里の小女人 提交于 2019-12-25 04:06:57
问题 i received a website built in php and mysql, but the coder left the default time zone in UTC format, how do i change that to EDT so all of the controls within the site now use EDT time NOT UTC. I've looked throughout the code and the coder calls strttotime in some places but i dont see timezone anywhere, the times that show up everywhere come from database columns containing UNIX timestamp with strttotime. 回答1: For PHP: date_default_timezone_set('America/New_York'); http://php.net/manual/en

xml schema Timezone

故事扮演 提交于 2019-12-25 03:36:29
问题 I received some xml data that includes a timestamp taken at midnight of the application's local time in the xml schema standard dateTime format (see http://www.w3.org/TR/xmlschema-2/#dateTime for reference). The timestamp is: 2012-02-04T13:00:00Z Based on information I've been able to find, the relevant timezone is '(GMT+13:00) Nukualofa' which corresponds to the location 'Pacific/Tongatapu'. We are only supposed to be receiving data with timestamps that correspond to timezones/locations

Current date/time in Java under Citrix Xenapp 6.5

删除回忆录丶 提交于 2019-12-25 03:32:21
问题 We maintain a legacy Java application which has just recently migrated to the XenApp 6.5 platform. But when we display the current time it is displaying the server time and not the user's time on the Powered Shared Desktop. For example, the user is in timezone offset 9.5, but when outputting the timezone it is displayed as 10. We have tried: TimeZone.getDefault().getID()); System.getProperty("user.timezone")); And we are getting the time by: private final static DateFormat dateFormat = new

Java.util.date get the actual date at client timezone

末鹿安然 提交于 2019-12-25 03:22:28
问题 Searching up and down, right and left - don't find simple answer to this question: I have java.util.Date instance, which get its value from mySQL. Also I have time-zone code of the logged-in user. I need to get the actual time at user time-zone. For example: My server-machine time-zone is GMT+2. My date value in DB is: 2017-02-09 16:38:58.000 According to my server-machine-time-zone I get it into date instance as: 2017-02-09T16:38:58.000+0200 Now I need to know what to do if: In case, for

How to sort an event table by time (have different timezones)?

余生长醉 提交于 2019-12-25 02:44:28
问题 I have a table that is structured the following way (that i can't change): EventName, LocalTime, Timezone Data would be something like this: Event1, 10:00, ET Event2, 11:00, ET Event3, 12:00, ET Event4, 10:00, CT how can i write a sql to sort this by actual time so result would be like: Event1, 10:00, ET Event2, 11:00, ET Event4, 10:00, CT Event3, 12:00, ET Note that Event2 and Event4 happen at the same time so whichever comes first doesn't matter. My database is MySQL. Again, I can not

In OpenERP my timezone aware datetimes are still being treated as UTC — why?

安稳与你 提交于 2019-12-25 01:56:42
问题 I understand that OpenERP since 6.1 decided to exclusively use the UTC timezone for storage of datetimes, but why does it ignore the timezone of my tz-aware datetimes? 回答1: This is a bug in OpenERP probably since 6.1. This patch (against 7.0) fixes it. For the curious, the heart of the fix is a few lines to the .../openerp/osv/fields.py module: UTC = pytz.timezone('UTC') . . . class datetime(_column): ... _symbol_c = '%s' def _symbol_f(symb): if symb is None or symb == False: return None elif

Getting different timestamp in Mysql and Javascript for the same date?

放肆的年华 提交于 2019-12-25 01:50:06
问题 In Javascript new Date() Tue Mar 18 2014 18:54:17 GMT+0000 (GMT) Date.UTC(2014,03,18) 1397779200000 In Mysql mysql> SELECT NOW(), UTC_TIMESTAMP(); +---------------------+---------------------+ | NOW() | UTC_TIMESTAMP() | +---------------------+---------------------+ | 2014-03-18 18:55:04 | 2014-03-18 18:55:04 | +---------------------+---------------------+ mysql> select UNIX_TIMESTAMP('2014-03-18') ; +------------------------------+ | UNIX_TIMESTAMP('2014-03-18') | +--------------------------

How to handle conversion of a DateTime independently of the timezone of the hosting server?

拈花ヽ惹草 提交于 2019-12-25 01:48:48
问题 I have an application which potentially rans in different timezones in the world, to name a few it runs in Germany & UK. Now I have a requirement wherein I have to interpret datetime objects as they are GMT dates, and then get the equivalent UTC datetime out of it. This should happen irrespective of timezones, for example if the application is running in Germany as well the DateTime should be interpreted as GMT and converted to UTC before saving on the server.I do deal will DST shifts as well

Format date using DateTime.ToString() based on TimeZone

可紊 提交于 2019-12-25 01:12:44
问题 I read the following question Creating a DateTime in a specific Time Zone in c# and was able to create a DateTime with TimeZone information. But I need to convert the DateTime to string value based on TimeZone. E.g. I've set the TimeZone as India Standard Time and created a DateTime, when I tried to convert to string using ToString() instead of 13/12/2019 4:00:00 PM , I am getting 12/13/2019 4:00:00 PM . Since I've set the TimeZone as India Standard Time, I would like to display the date in

date(“H:i:s”) show +1 time in php

眉间皱痕 提交于 2019-12-25 00:36:09
问题 Im in Asia/Jakarta timezone (UTC +7). When i run this date("H:i:s") , it shows +1 time. Example 01:00 am in GMT, so it show 09:00 which should show 08:00. I already changed my php.ini. It's look like this. [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "Asia/Jakarta" What should i do to make it right ? Thank you. 回答1: try using date_default_timezone_set <?php echo date("H:i:s"); date_default_timezone_set("Asia/Jakarta"); echo