MomentJS countdown with diff

I am constructing a session timeout as part of a web application using the MomentJS library. What I have so far (below) is the timeToExpire difference (in seconds) from when the user logged in and when the session will expire. However when displaying...
more »

2017-02-19 18:02 (1) Answers

Angular - Mongoose : Can't manipulate dates

I have been searching for a long while for solution, but nothing helped me. I have an Angular JS app which runs with Mongoose and Express. I want to store date as object from a simple form. But when I submit my form, dates are stored as String and...
more »

2017-02-19 15:02 (1) Answers

Get weekday by number

We all know date('w'). What I am trying to do is to find the next Date with the index retrieved from another date('w'). I tried: $saturday = 6; if((int)date('w') < $saturday){ $targetdate = strtotime('last Sunday +'.$saturday.' days'); }el...
more »

2017-02-19 14:02 (1) Answers

Date formatting exception

i have the following date 2017-02-19T12:23:37.000000-00:00 And this code : Long tt = null; String date = "2017-02-19T12:23:37.000000-00:00"; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); try { ...
more »

2017-02-19 14:02 (3) Answers

Convert seconds to HH-MM with JavaScript?

I have been using this excellent function for HH:MM:SS, but how could I modify it to return only HH:MM with either the seconds truncated or rounded. function formatSeconds(seconds) { var date = new Date(1970,0,1); date.setSeconds(seconds); ...
more »

2017-02-19 12:02 (3) Answers

Oracle query - Displaying data grouped yearly

I am trying to display data grouped by 12 months period based on the min start date. If FTE was changed during the 12 month period, it will be listed with corresponding start and end date. Test data is provided as part of [Data grouped by date in or...
more »

2017-02-19 09:02 (1) Answers

How to print a given date in C

I am very new to C programming. I was trying to use the scanf function to ask the user to enter a date and display it in the console. So wrote the following codes: #include <stdio.h> #include <stdlib.h> int main() { int date, month,...
more »

2017-02-19 07:02 (4) Answers

google apps scripts date formatting

I'm having trouble with something that should be very simple - just creating a Date() in Google Apps Script (javascript) var thisdate = new Date('2017-02-12'); Logger.log(thisdate.toString()); This test results in 'Invalid Date'... I must be missi...
more »

2017-02-18 14:02 (2) Answers

Ionic 2 Date Pipe adds hour

I've got a webservice which provide my app from data. Currently I've got issues with dates. In my Ionic pages i use the date pipe like this: {{model.DateStart | date: 'dd-MM-yyyy HH:mm'}} This results in '18-02-2017 14:08', thats good. But when t...
more »

2017-02-18 14:02 (1) Answers

Laravel show different date from my database

I have a problem in my project. When I store value in my database it works perfectly fine. But when I want to show the value it gives me an undefined date that is not stored in my database. Here In my database the created_at field value is 2017-02-...
more »

2017-02-18 12:02 (1) Answers

Data grouped in 12 month period

I have 2 tables Create table t ( employee varchar2(10), job varchar2(5), start_date date, end_date date, amt number ); With the following data insert into t values (1111,1,19-May-2008,20-May-2008,7); insert into t values (1111,1,...
more »

2017-02-18 09:02 (0) Answers

How to parse datetime with optional sections?

I've datetime that may be one of the following formats: MM/dd/yy M/dd/yy MM/d/yy M/d/yy Any of the above with HH:mm Any of the above with 4-digit year The DateTimeFormatter I built is as follows: new DateTimeFormatterBuilder() .appendValue(C...
more »

2017-02-18 03:02 (1) Answers

postgresql create table of days per month

I'm trying to write a script which returns a list of months with the number of days in the month. It references this table CREATE TABLE generic.time_series_only (measurementdatetime TIMESTAMP WITHOUT TIME ZONE NOT NULL) which is just a chronolog...
more »

2017-02-17 21:02 (3) Answers

How to add timestamp for CardView

I am using FirebaseRecyclerAdapter my issue or problem is that I need to show timestamp for my posts card so I have searched for 3 months and I couldn't solve this problem so please brother I have done my best and it's time for getting help from othe...
more »

2017-02-17 21:02 (0) Answers

How to test Date(Invalid Date) with jasmine

To simplify, lets see this function getting date and returning a date modified (start of day): const getStartOfDay = date => { const newDate = new Date(date); newDate.setHours(0, 0, 0, 0); return newDate; } Now I want to implement some ...
more »

2017-02-17 18:02 (2) Answers

Moment JS Parse strange behaviour

I'm using moment.parse String+Format method when I call moment("=min(C2:C4)", 'DD/MM/YYYY') it evaluates to valid date Sun Apr 02 2017 00:00:00 GMT+0300 (FLE Daylight Time) I can't understand how moment parses "=min(C2:C4)" to valid date. Just won...
more »

2017-02-17 17:02 (1) Answers

How do I save date/time in some other timezone

I need to save a Date: February 16th, 2017 5PM HST. The database (Parse) only accepts JS Date. And, my system timezone is IST. JS Date does not have the ability to save in a different timezone. To overcome this, I save three variables. Date (Calcul...
more »

2017-02-17 13:02 (3) Answers

in sql convert time to timestamp

i have time like in ex: 10.45,13.00 now i need check that time as date in where my query is SELECT T.*, (SELECT a.driver_id FROM tbl_assigned_drivers a WHERE AND a.from_time<=T.time AND a.to_time >=T.time ...
more »

2017-02-17 08:02 (1) Answers

MySql backup with date in flename using php

my provider told me to use this script to create a Mysql backup: <?php $host= 'xxx'; $user= 'xxx'; $pass= 'xxx'; $db= 'xxx'; system(sprintf( 'mysqldump --no-tablespaces --opt -h%s -u%s -p"%s" %s | gzip > %s/dumpDB.sql.gz', $host, $user, $pass...
more »

2017-02-16 17:02 (3) Answers

SQL Date Col - Use DATE or Varchar?

I have very simple code, but the issue is that when I convert a date column to Varchar(10), then I am not fetching distinct dates and sort is not working as desired; when I use DATE format, then I am fetching distinct dates and date sort is working, ...
more »

2017-02-16 16:02 (0) Answers

sql dates quater of specific year

I am trying to create a report that gives me number to an event that occurred in the week, month and quarter of a specific date. I have been able to so so for weeks and months but having issue with quarter. I want results for quarter of that specific...
more »

2017-02-16 15:02 (2) Answers