dst

Java daylight saving seems to be wrong

≡放荡痞女 提交于 2020-01-05 05:53:58
问题 I've been facing some issues with timezone with Java since yesterday (21/10/2018). Looks like java is considering that daylight saving have taken place in Brazil but it hasn't. I created the following test to be sure public static void main(String[] args) { ZonedDateTime dateTime = LocalDateTime.now().atZone(ZoneId.systemDefault()); System.out.println(dateTime); ZonedDateTime saoPaulo = dateTime.withZoneSameInstant(ZoneId.of("America/Sao_Paulo")); ZonedDateTime cuiba = dateTime

What is the most reliable way to schedule a job with cron scheduler is Quartz that repeats every N days starting from a specific date

我只是一个虾纸丫 提交于 2020-01-04 11:02:23
问题 In our app, we have an ability to schedule tasks and we converting this functionality to Quartz. One of the problems that I have is scheduling recurring task that should run, for example, every third day. The cron expression that I had in mind first of all is: 0 37 18 */3 * ? * But what this will do, is execute that job on 1,4,7, etc... Which is fine, assuming that I want to start from the first day of the month. However, how to deal with this issue if I need to start from 11th? I could do

What is the most reliable way to schedule a job with cron scheduler is Quartz that repeats every N days starting from a specific date

随声附和 提交于 2020-01-04 11:01:48
问题 In our app, we have an ability to schedule tasks and we converting this functionality to Quartz. One of the problems that I have is scheduling recurring task that should run, for example, every third day. The cron expression that I had in mind first of all is: 0 37 18 */3 * ? * But what this will do, is execute that job on 1,4,7, etc... Which is fine, assuming that I want to start from the first day of the month. However, how to deal with this issue if I need to start from 11th? I could do

1º Day of Daylight Saving Time Java and JS showing a different behavior

a 夏天 提交于 2020-01-04 09:05:45
问题 Assuming Brasilia GMT -0300: DST on 21/10/2012 at 00:00:00, when the clock should be advanced by one hour Java new Date(2012 - 1900, 9, 21, 0, 0, 0) Sun Oct 21 01:00:00 BRST 2012 Chrome/FireFox (console) new Date(2012, 9, 21, 0, 0 ,0) Sat Oct 20 2012 23:00:00 GMT-0300 (Hora oficial do Brasil) The result in Java is what I was expecting, but the result in JS I can not understand. I found this post where bjornd says This is an absolutely correct behavior but didn't explain why this behavior is

How to get the time zone name for a CLLocation

半城伤御伤魂 提交于 2020-01-02 20:12:24
问题 I have an application that uses a CLGeocoder to forwardGeocode a placemark from an address string. The CLPlacemark response contains a CLLocation which gives me GPS coordinates. The only way to create an NSTimeZone seems to be by using the correct Time Zone Name. It is important to point out that I am not using the current location of the device, so [NSTimeZone localTimeZone] will not work for me. Is there a way to get the timezone name for the CLLocation so that I can create an NSTimeZone

SimpleDateFormat parse is one hour out (using RFC 1123, GMT in summer)

心不动则不痛 提交于 2020-01-02 08:09:40
问题 I am using SimpleDateFormat with RFC 1123 to format dates, and to parse dates. However, parse(format(date)) is sometimes one hour different from the original date. The code below: public static void main(String[] args) throws ParseException { String RFC1123_DATE_PATTERN = "EEE, dd MMM yyyy HH:mm:ss zzz"; SimpleDateFormat dateFormat = new SimpleDateFormat(RFC1123_DATE_PATTERN); Date date = new Date(1000); String str = dateFormat.format(date); Date date2 = dateFormat.parse(str); System.out

Daylight Saving Time start and end dates in Ruby/Rails

主宰稳场 提交于 2020-01-02 04:36:29
问题 I'm working on a Rails app where I need to find the Daylight Saving Time start and end dates given a specific offset or timezone. I basically save in my database the timezone offset received from a user's browser( "+3" , "-5" ) and I want to modify it when it changes because of daylight saving time. I know Time instance variables have the dst? and isdst methods which return true or false if the date stored in them is in the daylight saving time or not. > Time.new.isdst => true But using this

tzset and daylight global variable interpretation in time.h

邮差的信 提交于 2020-01-02 03:32:08
问题 In the time.h header for the daylight global variable it says: "This variable has a nonzero value if Daylight Saving Time rules apply. A nonzero value does not necessarily mean that Daylight Saving Time is now in effect; it means only that Daylight Saving Time is sometimes in effect." Now I've noticed that in both Solaris 11.2 and Linux the "daylight" variable is being set to 1, even though my time-zone does not use daylight savings at all (Australia/Brisbane). Sample code confirms this, if I

moment.js, timezones and daylight savings

北战南征 提交于 2020-01-02 02:01:35
问题 I return a list of UTC dates/times from a .Net service, formatted like so: "2013-07-09 19:48:07 +00:00". On the client, I convert each of these string values into a corresponding UTC-based moment, like so var fooUtc = new moment.utc(serverDateTimeString) On the page, there is a droop-down containing a list of time-zones that the user can change. These are tied to a collection of time-zone objects like the following: { id: "Central Standard Time", label: "(UTC-06:00) Central Time (US & Canada)

moment.js, timezones and daylight savings

南楼画角 提交于 2020-01-02 02:00:05
问题 I return a list of UTC dates/times from a .Net service, formatted like so: "2013-07-09 19:48:07 +00:00". On the client, I convert each of these string values into a corresponding UTC-based moment, like so var fooUtc = new moment.utc(serverDateTimeString) On the page, there is a droop-down containing a list of time-zones that the user can change. These are tied to a collection of time-zone objects like the following: { id: "Central Standard Time", label: "(UTC-06:00) Central Time (US & Canada)