Why is SimpleDateFormat changing the date?

Given the following code: [...] public void testFormatDateString() throws ParseException { String dateString = new java.util.Date().toString(); System.out.println(dateString); SimpleDateFormat format = new SimpleDateF...
more »

2017-08-19 19:08 (3) Answers

Generate a unique code using date and time

First of all sorry for my bad english. I'm working on a project and I need to generate a code (ID) that I can verify later. As my project is very extensive I will give you and example and later what I need to solve. Example: I have a code that get...
more »

2017-08-19 19:08 (1) Answers

moment.js parse date in language and timezone

I want to convert date in different timezone that I have as string to a ISO date. What works: parsing a non-localized date in moment with a timezone: var sdate = "2016-12-13 09:45:46" var m = moment.tz(sdate, "Europe/Amsterdam"); var iso = m....
more »

2017-08-19 11:08 (1) Answers

Count result date when they are equals

I only ned Date where they are not repeated like: Date Quantity 2017-06-20 9 2017-08-18 88 2017-06-21 30 So i tried: select CONVERT(date, UpdatedDate) as 'Date', COUNT(*) as 'Flights Quanttity' from FlightS...
more »

2017-08-18 18:08 (1) Answers

Show current date time from CRM in the front end?

I have the logic below the Answer Value in CRM is 01/08/2015 23:00:00, however in the front end changes the expiry date to show 02/08/2015, its adding 1 day not sure why, how would I show the same date from CRM? below is my code, do I have to do belo...
more »

2017-08-18 13:08 (2) Answers

convert csv column data type using python

I have a csv sheet with 2 columns Subject,Exam_Date Maths,4/13/2017 Physics,4/15/2016 English,42936 In this example - 42936 is actually 7/20/2017. Since the excel cell data type was general - value got changed to 42936. I have a pytho...
more »

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

Finding difference in dates by grouped variable

I am working on my Master's Thesis and need help with some R coding. I am analyzing movements of wild turkeys during different stages of reproduction. I need to find the difference in the last date and the first date that an individual was within an ...
more »

2017-08-18 01:08 (2) Answers

Ruby difference between two dates

I need to check the difference between two date and check if there is 24 hours or more. I am having trouble in calling the to_time method of the date object. This to_time method is turning the minutes and seconds if the current date to 00:00:00. Exa...
more »

2017-08-17 19:08 (2) Answers

PHP change date after x hours

In my code I am successful to display current date but my requirement is to show next day date after 3 hours e.g. 2017-08-17 20:00:00 the next date will be 2017-08-18 but it will show next date after spending 3 hours i.e. 2017-08-18 03:00:00 until th...
more »

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

Change/set date in Freemarker

I have to use two dates to get some data (somenumbers): start_date and end_date. The end_date should be now but I want the start_date to be the 1st of the current month, which means the start_date's date should always be 1st. Is it possible to do s...
more »

2017-08-17 13:08 (2) Answers

Get Date from week number in Swift 3

I have myYear and myWeek strings comes from apis , I want to convert them to date string like YYYY-mm-dd how can I do it in swift 3 ? my strings under below. let myYear = "2017" let myWeek = "8" ...
more »

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

JSON Sorting by date

First of all i'm a complete newbie to this json, i have searched for solutions but seem i did not find the trick. Where data looks like this: Array ( [0] => Array ( [debtor_name] => Name 1 [debtor_number] =...
more »

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

Convert datetime to date using a function

I have one column in my database that I need to convert from datetime to the date data type using a SQL Server function. I can't figure out how to get the correct syntax. Could I get some help with the syntax so IntelliSense will stop yelling at me a...
more »

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

Using sinon to mock a date object

Here is my code: var startTime = new Date(startDateTime).toLocaleTimeString("en-US", options); I need to get that startTime in my unit test. From knowing unit testing in a java perspective, I would approach this problem as How can I mock the new d...
more »

2017-08-16 23:08 (1) Answers

Compare julian date with Normal date in SQL

I am trying to convert a Julian date to Gregorian Date (MM/DD/YYYY) and compare it with a normal date: WHERE CONVERT(VARCHAR, dbo.ConvertToGregDate(ExpDate), 101) < '04/01/2017' This returns all the dates before 04/01 disregarding the year (e.g...
more »

2017-08-16 22:08 (1) Answers