Questions tagged [days]

A day is a unit of time which is equal to an interval of 24 hours. It may be used for example for measuring the length of a period (see also period tag). For questions about dates or day of week rather consider tags like date or dayofweek.

554 questions
8
votes
9 answers

Swift - Get last 7 days starting from today in array

How to get previous 7 days of the month I know how to get if today is 18, but what if today id 3rd November? How to get the last 4 days from the previous month(October) in Int?
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
8
votes
4 answers

Displaying a sequence of days

Let's say I have these arrays of numbers which correspond to the days in a week (starting on Monday): /* Monday - Sunday */ array(1, 2, 3, 4, 5, 6, 7) /* Wednesday */ array(3) /* Monday - Wednesday and Sunday */ array(1, 2, 3, 7) /* Monday -…
Willem-Aart
  • 2,200
  • 2
  • 19
  • 27
7
votes
6 answers

Joda time - all mondays between two dates

I am using Joda time api in a Spring 3.0 project for the very first time. Now I have a start and end date and I want to get the date for all mondays between these two dates. How can I do this ? I have no idea where to start, can someone please…
Faiyet
  • 5,341
  • 14
  • 51
  • 66
6
votes
2 answers

Calculate number of weeks , days and hours from milliseconds

There were many similar questions around but none addressed this calculation. Using javascript i it is easy to find the number of milliseconds diff b/w 2 dates for ex: var mil = Math.floor(new Date("1/1/2012") - new Date("1/7/2012")) mil is…
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178
6
votes
4 answers

Add days to current date from MySQL with PHP

I have a fixed date from MySql startDate = 07/03/2011 I wanted to add 60 days on top this date to have an endDate. $startDate = $result['startDate']; $endDate = ??? + strtotime("+60 days"); echo $endDate; From my research, I know it has something…
6
votes
1 answer

java.util.Date Calculate difference in days

I tried to calculate the difference between two dates and I noticed one thing. When calculating only the days, the start of daylight saving time is included in the interval, so the result will be shorter with 1 day. To obtain accurate results, the…
tib
  • 195
  • 1
  • 7
5
votes
4 answers

Android: How to calculate a date some days ago?

I get the today's date like this: final Calendar cal = Calendar.getInstance(); { mYear = cal.get(Calendar.YEAR); mMonth = cal.get(Calendar.MONTH); mDay = cal.get(Calendar.DAY_OF_MONTH); } I want to calculate what was the date x days ago...…
Alex Fragotsis
  • 1,248
  • 18
  • 36
5
votes
1 answer

Grouping records hour by hour or day by day and filling gaps with zero or null

I have written a query that counts records hour by hour: select TO_CHAR(copied_timestamp, 'YYYY-MM-DD HH24'),count(*) from req group by TO_CHAR(copied_timestamp, 'YYYY-MM-DD HH24'); the result is: 2012-02-22 13 2280 2012-02-22 15 …
Mehdi
  • 4,396
  • 4
  • 29
  • 30
4
votes
2 answers

How to get total day count in a month

I want to find a total days per month group by days. For Example Month is '01/2011' (mm/yyyy) Expected Output Sunday - 5 Monday - 5 Tuesday - 5 Wednesday - 4 Thursday - 4 Friday - 4 Saturday - 4 Tried Code Dim lngCnt As Long Dim strOut As…
Gopal
  • 11,712
  • 52
  • 154
  • 229
4
votes
5 answers

Calculate number of days remaining

I would like to calculate the number of days remaining before a date. In my database I have a timestamp corresponding to the end date. For example Friday 30. I would like to say something like that : 7 days remaining... 6, 5, 4, etc Can you help me…
BobbaFett
  • 73
  • 1
  • 1
  • 4
4
votes
9 answers

Javascript get weekdays between two specific weekdays

How can I get all weekday names between 2 weekdays as parameters? It should also return accurately when it get past the 7 days. My week format is: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' Example and…
marknt15
  • 5,047
  • 14
  • 59
  • 67
4
votes
4 answers

get between two date all days for every Month in PHP

How i can to get all days for every Month between two days in array like this $dateStart = "2016/12/14"; $dateFin = "2017/04/21" [2016/12/14 - 2016/12/31] => 17 days [2017/01/01 - 2017/01/31] => 31 days [2017/02/01 - 2017/02/28] => 28…
Younes Zaidi
  • 1,180
  • 1
  • 8
  • 25
4
votes
3 answers

Casio - Basic programming

It's a bit urgent... ;) Someone i know have a Casio calculator (FX-9750 / Grahp35+). There is in the menu a functionnality TVM with "Days Calculation" that permits to know the number of days between 2 dates. I have to program for this calculator…
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
4
votes
2 answers

java.time.Period to seconds

How to convert java.time.Period to seconds? The code below produces unexpected results java.time.Period period = java.time.Period.parse( "P1M" ); final long days = period.get( ChronoUnit.DAYS ); // produces 0 final long seconds = period.get(…
4
votes
2 answers

How to get the Days b/w current week in moment.js

I'm new to angular js and moment.js i have the following code which gives the start day and end day of a week like January 17th-January 23rd. but i want all the 7 days in this format january 17, monday. My code var…
Ranjith M
  • 519
  • 3
  • 6
  • 24
1
2
3
36 37