date-arithmetic Questions

6

Solved

In a Perl program I have a variable containing date / time in this format: Feb 3 12:03:20 I need to determine if that date is more than x seconds old (based on current time), even if this occu...
Bookrack asked 3/2, 2012 at 20:1

3

Objective I am trying to calculate the distance in weeks since a given date without jumping through hoops. I'd prefer to do it in plain Ruby, but ActiveSupport is certainly an acceptable alternati...
Serialize asked 29/1, 2016 at 17:20

1

Solved

I have a set of data for some tickets, with datetime of when they were opened and closed (or NULL if they are still open). +------------------+------------------+ | opened_on | closed_on | +-------...
Malcommalcontent asked 30/9, 2020 at 10:9

10

Solved

See the results of below queries: >> SELECT ADD_MONTHS(TO_DATE('30-MAR-11','DD-MON-RR'),-4) FROM DUAL; 30-NOV-10 >> SELECT ADD_MONTHS(TO_DATE('30-NOV-10','DD-MON-RR'),4) FROM DUAL; 3...
Santonin asked 18/3, 2011 at 7:32

13

Solved

I need to add 30 minutes to values in a Oracle date column. I do this in my SELECT statement by specifying to_char(date_and_time + (.000694 * 31) which works fine most of the time. But not when ...
Trihedron asked 2/11, 2008 at 20:34

4

I am using Postgres 9.0 version. I want to add some months to a date to calculate the new date and update in a table. Here the number of months to be added will be in integer variable. My code is a...
Kinetic asked 17/9, 2013 at 13:41

7

Solved

I have a date field DATE = 10/10/2010 sum = 4 (this are number of years by calculation) is there a way to add four years to 10/10/2010 and make it 10/10/2014?
Cirone asked 16/2, 2012 at 14:41

9

Solved

PHP provides ways to get the number of the current day of the month (date('j')) as well as the number of the current day of the year (date('z')). Is there a way to get the number of the current day...
Conservatory asked 5/8, 2009 at 16:51

5

I'm trying to subtract date from Oracle so it even effect the day as well. For example, if the timestamp is 01/June/2015 00 hours and if I subtract 2 hours, I want to be able to go to to 31/May/20...
Charlatanry asked 11/6, 2015 at 5:38

1

Solved

I've a query like this in PostgreSQL: select count(id_student) students, date_beginning_course from data.sessions_courses left join my_schema.students on id_session_course=id_sesion where course...
Equipment asked 11/9, 2019 at 23:42

5

Solved

How can you calculate the following Friday at 3am as a datetime object? Clarification: i.e., the calculated date should always be greater than 7 days away, and less than or equal to 14.
Amoral asked 13/3, 2010 at 1:2

4

Solved

I'm trying to print for each person its age using this format : E.g : 19 years , 8 months , 13 days. I've googled a lot and I've noticed that there is a specific function to calculate the differe...
Reflectance asked 26/10, 2015 at 10:36

6

Solved

I have 2 dates, say 28-Mar-2011 and 29-Jun-2011. I need an sql query that will display the months between these 2 dates including the months containing the dates, ie. June, May, April and March.
Fez asked 3/8, 2011 at 13:7

11

Solved

How do I do time/hour arithmetic in a Google spreadsheet? I have a value that is time (e.g., 36:00:00) and I want to divide it by another time (e.g., 3:00:00) and get 12. If I divide just one by t...
Sirius asked 17/1, 2012 at 5:16

3

Solved

I have a shell script that runs every night to backup my EC2 sites database and html to S3, and when it backs the folders up, it appends the date to it for easier viewing. But I want it to also be ...
Karonkaross asked 20/6, 2011 at 20:42

4

Solved

I need a function in Oracle like this. When i giving a parameter a simple date. Then function should getting me last day of the previous month. Example: FunctionName(10.02.2011) Result should b...
Goody asked 10/2, 2011 at 12:43

3

Solved

I have a dataframe with records spanning multiple years: WarName | StartDate | EndDate --------------------------------------------- 'fakewar1' 01-01-1990 02-02-1995 'examplewar' 05-01-1990 03-0...
Attestation asked 20/5, 2018 at 23:9

8

Solved

Duplicate of What's the BEST way to remove the time portion of a datetime value (SQL Server)? I have a column that tracks when things are created using a datetime, but I'd like to generate a repor...
Deflective asked 11/2, 2009 at 19:38

4

Solved

How can I get the last day (Dec 31) of the current year as a date using PHP? I tried the following but this doesn't work: $year = date('Y'); $yearEnd = strtotime($year . '-12-31'); What I need...
Madelene asked 24/2, 2014 at 0:35

8

Solved

I have been given a date, Which I am taking as an input like (day, month, year): 12, 03, 87. Now I need to find out the date after n days. I have written code for this, But its not efficient. Can...
Watershed asked 27/3, 2013 at 20:20

12

Solved

I am trying to calculate business days between two dates in Oracle select. I got to the point when my calculation gives most results correct for given dates (I compare it with NETWORKDAYS in excel)...
Prosser asked 15/2, 2013 at 15:51

7

Solved

I have a monthly amount that I need to spread equally over the number of days in the month. The data looks like this: Month Value ----------- --------------- 01-Jan-2012 100000 01-Feb-2012 121002 ...
Amata asked 7/12, 2012 at 16:1

8

Solved

I am trying to add a month to a date i have. But then its not possible in a straight manner so far. Following is what i tried. d <- as.Date("2004-01-31") d + 60 # [1] "2004-03-31" Addin...
Southeastwardly asked 5/1, 2013 at 7:20

3

Solved

is there a way to get all weeks of a year plus start and ending days of every week ? (With Joda-Time) something like this (2012) : week : 21 start: 21.05.2012 ending : 27.05.12 Thanks for your ...
Radnorshire asked 23/5, 2012 at 13:34

3

Solved

I wish to label my data based on their week. This is my data: df2 <- structure(list(Order_Date = structure(c(16735, 16805, 16753, 16830, 17075, 17009, 17085, 16740, 16891, 16750, 16820, 16849...
Squirt asked 14/11, 2016 at 4:1

© 2022 - 2024 — McMap. All rights reserved.