timezone

Yii2 and storing data in database as UTC

末鹿安然 提交于 2020-01-14 03:12:06
问题 I'm using Yii2 and I was wondering how it decides what timezone to store the data in the database as? I have noticed the $defaultTimezone which seems to indicate it simply controls what timezone your input data is supposed to be when passing it to functions such as the the asTime function and it uses the formatter timezone to convert said data into the correct time output. But I'm wondering how do you make sure it is inserting the data into your database in the right timezone so then the

Removing Timezone for DateTime.ParseExact

…衆ロ難τιáo~ 提交于 2020-01-13 17:07:49
问题 I am trying to parse a string into a datetime with the following format: [Day],[Date] [Month] [Year] [Time][am/pm] [timezone] (example:) "Thursday, 1 Dec 2011 08:30pm EST" I've done this using a DateTime.ParseExact with the format("dddd, dd MMM yyyy hh:mmtt"). However the timzone is giving me an issue. There is no code for reading the timezone written in that manner. I don't care about the timezone anyway, so I want to either strip it out or read it - as long as the parsexact will work. One

Formatting XmlGregorianCalendar timezone issue

左心房为你撑大大i 提交于 2020-01-13 16:54:32
问题 I need to format java XmlGregorianCalendar to "yyMMdd" string. My implementation: XMLGregorianCalendar date = getDate(); //getting the date if (date != null) { SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); LOG.debug("Parsing date..."); LOG.debug("XML Date: " + date); LOG.debug("XML Date timezone: " + date.getTimezone()); GregorianCalendar gc = date.toGregorianCalendar(); LOG.debug("Gregorian calendar: " + gc.toString()); LOG.debug("Gregorian calendar timezone id: " + gc.getTimeZone()

logging module for python reports incorrect timezone under cygwin

回眸只為那壹抹淺笑 提交于 2020-01-13 09:44:30
问题 I am running python script that uses logging module under cygwin on Windows 7. The date command reports correct time: $ date Tue, Aug 14, 2012 2:47:49 PM However, the python script is five hours off: 2012-08-14 19:39:06,438: Done! I don't do anything fancy when I configure logging for the script: logging.basicConfig(format='%(asctime)-15s: %(message)s', level=logging.DEBUG) Can someone tell me what is going on and how I can fix it? 回答1: You need to unset the environment "TZ" in your python

hibernate.jdbc.time_zone = UTC ignored

牧云@^-^@ 提交于 2020-01-13 09:32:24
问题 Using set up as Spring framework 5.0.2.RELEASE Spring Security 5.0.0.RELEASE Hibernate 5.2.11.Final I followed spring boot & Vlad's link to configure my application as below db.properties - jdbc.driverClassName = com.mysql.jdbc.Driver jdbc.url = jdbc:mysql://hostname:port/appname?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false jdbc.username = xxx jdbc.password = xxx jdbc.minPoolSize = 5 jdbc.maxPoolSize = 20 jdbc.maxIdleTime = 30000 hibernate.dialect = org.hibernate.dialect

hibernate.jdbc.time_zone = UTC ignored

[亡魂溺海] 提交于 2020-01-13 09:32:15
问题 Using set up as Spring framework 5.0.2.RELEASE Spring Security 5.0.0.RELEASE Hibernate 5.2.11.Final I followed spring boot & Vlad's link to configure my application as below db.properties - jdbc.driverClassName = com.mysql.jdbc.Driver jdbc.url = jdbc:mysql://hostname:port/appname?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false jdbc.username = xxx jdbc.password = xxx jdbc.minPoolSize = 5 jdbc.maxPoolSize = 20 jdbc.maxIdleTime = 30000 hibernate.dialect = org.hibernate.dialect

How to get timezone, Language and County Id in flutter by the location of device in flutter?

断了今生、忘了曾经 提交于 2020-01-13 07:40:16
问题 I am new to flutter, and I want to get Timezone, language, and county Id when I run my project on my device android or iOS. It should detect Timezone, language and country Id from the location of the device. I am newbie to flutter and don't know how can I get these. Is there any library or I can get these via the internal library, please suggest another way. 回答1: https://flutter.io/tutorials/internationalization/#tracking-locale Locale myLocale = Localizations.localeOf(context); provides

How to get timezone, Language and County Id in flutter by the location of device in flutter?

梦想的初衷 提交于 2020-01-13 07:40:07
问题 I am new to flutter, and I want to get Timezone, language, and county Id when I run my project on my device android or iOS. It should detect Timezone, language and country Id from the location of the device. I am newbie to flutter and don't know how can I get these. Is there any library or I can get these via the internal library, please suggest another way. 回答1: https://flutter.io/tutorials/internationalization/#tracking-locale Locale myLocale = Localizations.localeOf(context); provides

How to set default time zone in Java and control the way date are stored on DB?

大兔子大兔子 提交于 2020-01-13 05:00:07
问题 I've the following problem, that showed up when I installed my webapp's war on a virtual linux server. Here it is: my server system time seems correct, in fact typing date on shell comes out with: Mon Apr 11 11:47:30 CEST 2011 which is my "wall clock time". Even mysql works fine, if I do select now(), I get: mysql> select now() -> ; +---------------------+ | now() | +---------------------+ | 2011-04-11 11:52:57 | +---------------------+ 1 row in set (0.01 sec) But my application (Spring

time zones in POSIXct and xts, converting from GMT in R

主宰稳场 提交于 2020-01-12 21:25:12
问题 I have a bunch of 1 minute returns in an xts object with the index being POSIXct and time zone being GMT. The returns are on NYSE so I would like to convert to the eastern time zone but I would like to take care of the daylight savings time properly. What is the best way of doing this? I am a bit confused between the EST timezone and the EDT timezone. I would like my times to convert properly to the NY time in winter and summer. 回答1: Use indexTZ<- and the America/New_York timezone > tail(SPY)