Questions tagged [date-manipulation]
90 questions
3
votes
2 answers
Using Duration to check if hours between two days are still within Duration
I was working with LocalDateTime and trying to see if the purchase date(in my case) is withing last x units(days/hours)
I achieved this the following way
public static final int BOOK_PURCHASED_MIN_HOURS = 72;
private boolean…

Sandeep Nair
- 436
- 2
- 15
3
votes
1 answer
Converting string column to date format in datatable frame in python
For an easy example :
import datatable as dt
import pandas as pd
from datetime import datetime
d_t = dt.Frame(pd.DataFrame({"Date": ["04/05/2020", "04/06/2020"]}))
There is only a column named Date with two values in str32 type.
How could I…

Denny Chen
- 489
- 3
- 8
3
votes
3 answers
Convert days in decimal to years, months, days, hours, minutes and seconds
What I have:
A spreadsheet in which Column C consists of number of days in decimal format.
What I need:
I need Column E to convert the value of Column C to years, months, days, hours, minutes and seconds.
What I've tried:
The following formula works…

Clarus Dignus
- 3,847
- 3
- 31
- 57
3
votes
2 answers
batch file Subtracting hour current time on Windows
I need to subtract, for example, 1 hour from current time in a .bat file on Windows 7.
I do it like this.
set day=%date:~0,2%
set month=%date:~-7,2%
set year=%date:~-4,4%
:: ———————————————————————–
set hour=%time:~0,2%
set /A hour= hour - 1
if…

jjgarcía
- 589
- 1
- 4
- 26
3
votes
4 answers
Remaining Business Days This Month in Amazon Redshift
I would like to find a way to determine the remaining number of business days in this calendar month using Redshift. I currently have a MySQL version written by a friend. I don't know enough about how it was written to even translating into the…

Ross Bixler
- 33
- 1
- 3
3
votes
1 answer
How to display after 4 week date from now?I want to pass an argument
echo date( "F jS, Y" , strtotime("now +3 weeks") );
It gives the result as July 2nd, 2010 .
Fine.Now I want to pass the argument like this.
The original print_r($originalamount)
give the result like this
Array (
[0] => 4 Months
[1] =>…

svk
- 4,513
- 18
- 63
- 100
2
votes
3 answers
How do I do date manipulation in SpEL?
How can I do date manipulation in the Spring Expression language?

Adam
- 43,763
- 16
- 104
- 144
2
votes
3 answers
How to deduplicate date sequences across non-consecutive rows in R?
I want to flag the first date in every window of at least 31 days for each id in my data.
Data:
library(tidyverse)
library(lubridate)
library(tibbletime)
D1 <- tibble(id = c(12,12,12,12,12,12,10,10,10,10),
…

Ezra
- 21
- 4
2
votes
2 answers
SQL - Retrieve values in a single query with multiple where clauses
I have a table with the following data:
UserName | LastLogin
-------------------------------
User1 | 2010-10-25 10:05:47
User2 | 2010-10-23 11:10:27
User3 | 2010-10-12 05:39:34
User4 | 2010-10-20 12:22:11
User5 | 2010-09-17…

David Buckley
- 981
- 7
- 17
- 30
2
votes
1 answer
Find matches in NSDate array - Swift
I’m a newbie at both Swift (and coding in general) and stack overflow. SO has been tremendously helpful in learning how to code, so, countless thanks to the SO community for great questions and answers.
Here goes my first ever SO question…
I’ve been…

Zee A.
- 23
- 4
2
votes
2 answers
javascript date manipulation
I have a string
2010-08-02 12:13:06.0
and need to get something like
Fri Aug 6 2010
out of it (the input does not map to the output for the values I gave, just examples)
I fear Im going to have to do some string manipulation to get what I want; the…

hvgotcodes
- 118,147
- 33
- 203
- 236
2
votes
3 answers
Best practice to manage date and days
I am working on a project where I have many operations to manage.
Each operation have an end date and is composed by a certain amount of tasks.
I want to display reminders (a text displayed on the screen) if a task is not done before [end date] - X…

Atnaize
- 1,766
- 5
- 25
- 54
2
votes
6 answers
Grouping dates by month in an sql server query (stored procedure)
Im having a bit of a mental block on this one.
I got booking system for hotel rooms and it contains a table as so
BookingRoomLink
BookingId (FK)
RoomId (FK)
Start_Date
End_Date
I'd like to query the data to extract occupancy levels for each month.…

Matt
- 3,664
- 3
- 33
- 39
1
vote
1 answer
match a number (date) in a matrix - Matlab
I have an interesting problem that involves taking the last day from a matrix and finding its last month day. Eg, if the date today is Oct-10-2011, you try to search for Sep-10-2011 or the first day < Sep-10-2011 in the matrix.
Matrix has multiple…

Maddy
- 2,520
- 14
- 44
- 64
1
vote
0 answers
addin days in provided date by user
String pickupdate = pdate.getText().toString().trim();
// String dateBefore = "25/10/2022";
// create instance of the SimpleDateFormat that matches the given date
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
…

Shahzad Ali
- 3
- 3