Turn SQL date red if it's not the current date

I'm creating a simple PHP to do list. I want to turn the date red if it's not the current date. Here's part of my code, with the HTML removed: <?php include "connection.php";?> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $task = iss...
more »

2017-10-04 06:10 (1) Answers

How to reference today's date in JavaScript?

I have the following code. It is an Apps Script that gets all Google Calendar events between the two dates specified. // from https://blog.ouseful.info/2010/03/05/grabbing-google-calendar-event-details-into-a-spreadsheet/ function caltest3(){ //h...
more »

2017-10-03 17:10 (2) Answers

MySQL incorrect timestamp value

I'm trying to insert datetime value '1970-01-01 00:00:01' in timestamp column but MySQL returned an error "Incorrect datetime value: '1970-01-01 00:00:01' for column 'timestamp'" CREATE TABLE TST_TABLE ( tst_column timestamp NULL ) INSERT INTO TS...
more »

2017-10-03 17:10 (1) Answers

Python CSV Finding average time taken

I am trying to find the average time taken. The value 'x' will allow me to get the time taken for every row there is, but how am I able to find the average time taken for all the rows. I will think it is something like x divided by count, but I am no...
more »

2017-10-03 05:10 (0) Answers

Excel Date/Time Lookup Error

I have two columns of 15 minute date/time interval data. One is formatted in 24-hour time and the other 12-hour. These come from two different sources, and reformatting the source data is not an option. All of these intervals are showing as exact mat...
more »

2017-10-03 05:10 (2) Answers

Imputing partially missing dates

I have time series data of a clinical trial, in which patients are treated within treatment sequences. Patients can have up to 10 sequences. Each sequence has a start and an end date. In addition, patients have dates for enrollment, before the first ...
more »

2017-10-02 23:10 (0) Answers

Pandas DateTimeIndex - Shifting over index

So I'm working on some technical analysis using Pandas, however I'm struggling with the DateTimeIndex, since a lot of financial data doesn't have a consistent frequency. I use pandas_datareader to get yahoo finance data containing DateTimeIndex, Ope...
more »

2017-10-02 22:10 (1) Answers

Universal Sortable Format Specifier for only Date

Just looking through the Microsot Standard Date and Time Format Strings to find universal date format specifier(yyyy-MM-dd). I can see there is one for UniversalSortableDateTimePattern which is "u". and the date outputs as: yyyy'-'MM'-'dd HH':'mm':'...
more »

2017-10-02 13:10 (1) Answers

Fill NA row with previous value iteratively in R

Say you have something like this across various weeks in a given df: DoW Value Mon 1234 Tue NA Wed 5678 Thu 9123 Fri 4567 Sat 8912 Sun 3456 I'd like to fill every Tuesday's NA with Monday's value of it's correspondent week. How can I do this, pref...
more »

2017-10-01 23:10 (2) Answers

date half month not working

I tried to do like this date('Y-m-d', strtotime('0.5 months')); But it gives me date 1970-01-01 Expected date is 2017-10-15 So the question is why the half month is not working? ...
more »

2017-10-01 16:10 (2) Answers

Subtract month from date column

I would like to subtract one month from a date column in Amazon Redshift (a fork of PostgreSQL 8.0.2). So for each date column in a table, it will add another column date_minus_a_month. I tried this code Select date,date::date -interval '1 month'...
more »

2017-10-01 16:10 (0) Answers