Questions tagged [date-difference]

Date-difference will give difference in the number of days, months, years etc. between any two calendar dates. (synonyms in stackoverflow.com: datediff, date-diff, date-difference)

446 questions
-1
votes
1 answer

Difference between two dates #

I have to calculate number of days difference between today and SubmittedDate, but if I the SubmittedDate = today my Result = 0,430090... Instead of 1 here is my code: DaysDiff =…
BKChedlia
  • 327
  • 2
  • 4
  • 18
-1
votes
3 answers

echo a date 0 if the amount becomes minus

I have the following function function get_designment_info_by_id($id) { $this->db->where('designment_id', $id); $designment_info = $this->db->get('designments')->row_array(); $designment_info['image'] =…
sterrek
  • 57
  • 9
-1
votes
1 answer

How to calculate date of birth from current age according to current time

I need to calculate the date of birth of a person based on current day when giving the input as current age in java script. I searched it but not getting. I need to get the persons date of birth according to current date time. Any idea??
san797
  • 91
  • 1
  • 9
-1
votes
1 answer

Oracle display more than 24 hours

I have a table with two DATE columns END_TIME and START_TIME. On this table I run the following query: SELECT y.ID, TO_CHAR( TO_DATE('00:00:00', 'HH24:MI:SS') + (y.END_TIME - y.START_TIME) , 'HH24:MI:SS') AS RUNTIME, …
BaseBallBatBoy
  • 685
  • 2
  • 12
  • 25
-1
votes
2 answers

How to get date difference in php?

In php, if you have a string in the date/time format example "2013-09-08 00:25:31", how can you compare that with the current time, and get the difference in number of days? Thanks.
omega
  • 40,311
  • 81
  • 251
  • 474
-1
votes
3 answers

How to find the difference between two times in Android / Java?

Possible Duplicate: Calculating the Difference Between Two Java Date Instances i have two date values in two textboxes in string datatypes in HH:MM:SS format.HOw can i find difference between them and get result in HH:MM:SS?please help me...as…
jims
  • 21
  • 1
  • 5
-2
votes
1 answer

how to find date difference from two different table in mys

I have two tables 1)LEAD TABLE (which have 3 columns) Lead_ID || Created_Date || Industry 2)ACCOUNTS TABLE (which have 4 columns) Account_ID||Created_Date|| Revenue_Range|| Lead_ID How would I get the average number of days between a lead created…
neha jha
  • 3
  • 2
-2
votes
2 answers

Why ChronoUnit.HOURS.between() is NOT working?

I was trying to get the hours between two local dates. And I used the code below : LocalDate startDate = LocalDate.of(2000, 4, 30); long noOfHours = startDate.until(LocalTime.now(), ChronoUnit.HOURS); …
-2
votes
1 answer

Get difference between two dates with inputs of string

Want to get the difference between the two dates. Input: Dec 2016 to Feb 2018(string) Expected Output: 1 year 2 months is any optimized way to achieve this?
Surya S
  • 53
  • 8
-2
votes
4 answers

How to count days between to dates

So I would like to count how many days between two datepickers. So I tried to make two array but it didnt work any Ideas? Here my date pickers
-2
votes
3 answers

How to calculate date difference for group data

I would like to count the date-time difference, when I group the data. Lets have a look on table content example : id | session_id | created 1 | 101 | 1/10/2010 9:30:10 2 | 102 | 1/10/2010 9:31:10 3 | 101 | 1/10/2010…
KMG
  • 114
  • 7
-2
votes
3 answers

Difference between 2 dates in days and in double

I am working on an app and i need to get the difference between the actual date and a date inserted by the user, in days and in double. Any idea on how to make this? I've tried some things but without success.
YUCA
  • 1
  • 1
-2
votes
2 answers

Display "minutes ago" in android app

I tried my best to do research and look for the tutorial, but still confused about it. My problem is, I want to display something like "minutes ago" based on create date and time I fetched from json data. When I fetched the date and time from server…
-2
votes
2 answers

PHP DateTime Difference (Hours, Days, Weeks, Months)

I am creating PHP function that will return difference between two dates in a format: 2 Months, 3 Weeks, 6 Days, 3 Hours. I have tried to use PHP DateTime class, but it returns only Months, Days and Hours and I can not find a way to calculate…
Miljan Ilic
  • 27
  • 1
  • 3
-2
votes
1 answer

Date -3 hours in VBscript

How can I output a date minus 3 hours? Example: BookDate = 8/4/2014 9:00:00 PM DesirebleDate = 8/4/2014 6:00:00 PM Tried DesirebleDate = DateDiff("h", BookDate , -3) but it is outputing the amount of hours. Thanks.
Khrys
  • 2,670
  • 9
  • 49
  • 82