saving SQL server date with respect to time zones

I read the date documentation for SQL server and I just want to be sure that I m doing the right thing here, I m trying to save the date and time of creating the record using SYSDATETIMEOFFSET() but I understand that this value does not correspond t...
more »

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

Swift: Get 30 days before 'Specific Date'

I have a problem about showing specific date. Here the case, I have a random date from my API (06/16/2015) that always change. I put it into variable name toDate with Date type. I need to get 30 days before the toDate for my fromDate variable. I read...
more »

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

Convert YYYYMMDD to mm/dd/yyyy format in R

I have a dataframe in R, which has two variables that are dates and I need to calculate the difference in days between them. However, they are formatted as YYYYMMDD. How do I change it to a date format readable in R? ...
more »

2017-06-21 22:06 (2) Answers

Correct way to make a schedule

I've been debating whether to use Date functions or just whether there is a cleaner way to make an array of a given day's minutes at the moment my code reads like this; function emptySchedule() { $emptySchedule = []; for ($h = 0...
more »

2017-06-21 17:06 (2) Answers

Check today if in dates array

I'm trying to check if today ( at 0:00 ) is in a dates array, like so: var today = new Date(); today.setHours(0, 0, 0, 0); var holidays = [ new Date(2017, 5, 21, 0, 0, 0).getTime(), // Today new Date(2017, 5, 22, 0, 0, 0).getTime(), ...
more »

2017-06-21 11:06 (3) Answers

Android: assigning booleans to dates

I am creating an app that keeps track of whether a user has done an activity that day or whether they have not. I need a way to give today's date a value of either true or false which I can then access later. Any ideas? ...
more »

2017-06-21 03:06 (1) Answers

Group dataframe by dates in R

I have data read into dataframes in R. I want to be able to group all the data with dates corresponding to month into a new category called "January", or whatever month it is. For instance if I have a row that looks like this area file `#...
more »

2017-06-20 20:06 (1) Answers

Ruby: Datetime to UTC conversion

I am trying to convert the below date and time combination to UTC from_date: "2017-06-19",from_time: "14:00" to_date: "2017-06-19", to_time: "23:00" Timezone: EDT I am using below piece of code for conversion Date.parse(dt).to_datetime + Time.par...
more »

2017-06-20 16:06 (3) Answers

sqlserver format date time

I am not familar with sql server why i have the following error Conversion failed when converting date and/or time from character string. ... values (1, 'P' + char(10) + 'd' + char(10) + 'inst', CONVERT(VARCHAR(24),'18-01-2016 11:29:27',113)) the...
more »

2017-06-20 12:06 (2) Answers

osx monday date current week bash

I need to get an array of all the dates of the current week in BASH 4, in OSX. I tried to get the monday date, but on OSX the date doesn't work the same as Linux (gdate) The result I need : array=( 'YYYY-MM-DD', # MONDAY 'YYYY-MM-DD', # TUESDAY ...
more »

2017-06-20 12:06 (1) Answers

Align multiple time series in R

I imported into Excel some time series, I got 20 columns and every second column contain dates. I would like to have only one date column with all data aligned and NA where not available. 2007-06-11 1509 2007-06-11 1138 2008-01-17 990 2007-06-12 149...
more »

2017-06-20 07:06 (1) Answers

R + Adding n number of weeks to YYYYWW format

I am trying to add 52 weeks to a date variable which is in YYYYWW format. my initial date is 201616 (year 2016 and week 16) and i am trying to add 52 weeks to this date and the expected output is 201715. I tried couple of things but no luck, here is...
more »

2017-06-20 01:06 (2) Answers