Why does Javascript convert times differently?

These are my two codes: var date1 = new Date('2017-04-23'); var date2 = new Date('April 23, 2017'); console.log(date1); console.log(date2); this is the results: Sat Apr 22 2017 17:00:00 GMT-0700 (PDT) Sun Apr 23 2017 00:00:00 GMT-0700 (PDT) wh...
more »

2017-04-22 20:04 (1) Answers

How to speed up SQL query with date GROUP BY?

I have a normal SQLite database table called table1 with 7 columns and of course a rowid. The first column is an custom_id number, the second is date in format YYYY-MM-DD and other 5 are real number data columns. There are about 10M rows in the datab...
more »

2017-04-22 20:04 (2) Answers

Convert date string into array

I'm trying to convert my date string into an array. Date string: var date = "2017,03,23"; Desired result: [2017,03,23] Here is what I tried: var new_date = date.split(','); // result: ["2017", "03", "23"] I want [2017,03,23]. How do I do th...
more »

2017-04-22 03:04 (4) Answers

Difference between two ZonedDateTime in Period

Using LocalDate, I got the difference expressed in a Period instance. For example: LocalDate born = LocalDate.of(1990, Month.SEPTEMBER, 30); Period myAge = Period.between(born, LocalDate.now()); System.out.println("My age is: "+myAge.getYears()+" ye...
more »

2017-04-22 01:04 (3) Answers

R: using dates in bar graph with ggplot2

I would like to create a bar plot that displays the number of Date entries for a certain date in the y axis of a bar graph and the date on the x axis of a graph. At the same time, I would like to split the bar into a Yes and No section. Date,Hungry ...
more »

2017-04-21 22:04 (1) Answers

Convert a Julian date into Gregorian day in R

I have a dataframe with dates like 116032 on julian format . 1YYDDD, where YY are the 2 last digits of the year and DDD the day on that year, the firts 1 is always fix. So 116032 is 01-02-2016. I want to convert this julian dates into normal...
more »

2017-04-21 14:04 (1) Answers

php date can't get 24 digit time hour

I'm using date function $now=date("Y-m-d H:i:s"); in php 5.6.30, The browser output is string(19) "2017-04-21 02:54:54",That's abnormal. php.ini set is date.timezone = PRC Centos 7 system time: [root@localhost sync]# date Fri Apr 21 14:53:20 CST...
more »

2017-04-21 09:04 (3) Answers

Bash script - convert time according to template

My script is capturing time from docker container and next step i want to convert it to some format so i can substitute docker time with current system time and get the difference. So for now i want at least to convert it so my script will understan...
more »

2017-04-21 01:04 (1) Answers

Get date ISO string without time in javascript

Is there a way to obtain a ISO string of a new date type in javascript with time at midnight without rebuilding a new date with date parts nor formatting it? I've been trying this var date = new Date(); date.setHours(0, 0, 0, 0); document.write(d...
more »

2017-04-20 21:04 (1) Answers

How to get all missing days between two dates

I will try to explain the problem on an abstract level first: I have X amount of data as input, which is always going to have a field DATE. Before, the dates that came as input (after some process) where put in a table as output. Now, I am asked to ...
more »

2017-04-20 18:04 (3) Answers

Adjusting Factor to as.Date(), pre 1970

Good Morning, I have successfully pulled monthly market returns from 1900 to present day. However, I am having issues coercing the date column to something usable. The original CSV file has the date format as "1-Jan-2000" or "1-Apr-1970". The tim...
more »

2017-04-20 15:04 (0) Answers

How to get week starting date from a date in R

I have a dataset with a column containing dates. I want to find the week starting dates for those date values. I get the week number using week function from lubridate. For example, week(as.Date("04/20/2017", "%m/%d/%Y")) #Solution [1] 16 Inst...
more »

2017-04-20 15:04 (2) Answers

SQL distinct count from distinct rows?

The following line of code gives me the time needed without duplicates, helping me avoid the actual dates. SELECT DISTINCT TO_CHAR(Start_Date_Time, 'HH:MI AM') AS StartTime FROM Section GROUP BY Start_Date_Time; However, when I try to ...
more »

2017-04-20 02:04 (1) Answers

Cannot plot candlestick data from Huobi json data

import pandas as pd import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker from matplotlib.finance import candlestick_ohlc import matplotlib.dates as mdates import datetime as dt import urllib impor...
more »

2017-04-19 22:04 (2) Answers

Get dates of Mon-Fri of previous week

I'm trying to implement this SO answer to get the dates for Monday-Friday of the previous week, testing with this: Public Sub listPreviousWeekDays() Dim dayCtr As Long For dayCtr = 2 To 6 Debug.Print DateAdd("ww", -1, Now - (Weekday(Now, dayCt...
more »

2017-04-19 18:04 (2) Answers

Date format regex to match date separator

I am using below code to validate the date format in dd/mm/yyyy and dd.mm.yyyy format. function validateDate(date){ var matches, d, m, y, cDate, format, dateFormatObj; dateFormatObj = { format: /^(\d{2})[./](\d{2})[./](\d{4})$/, monthPos: 2,...
more »

2017-04-19 15:04 (3) Answers

Javascript date differs based on month format

While debugging my application I found weird thing: new Date('2017-5-19') -> Fri May 19 2017 00:00:00 GMT+0300 (FLE Summer Time) new Date('2017-05-19') -> Fri May 19 2017 03:00:00 GMT+0300 (FLE Summer Time) I set date from String, like '201...
more »

2017-04-19 12:04 (1) Answers