Questions tagged [date-arithmetic]

The term 'date-arithmetic' refers to determining via code such information as how many days, hours, etc. between two calendar dates, and determining the last day of the month, or whether a date is a weekday or a weekend. Be sure to also include the appropriate programming or database tag.

Many computer languages provide for date arithmetic, including , , and languages. Most languages store data with a type of date internally as a number of days since a certain date, such as January 1st 1970 for Unix.

Typical Considerations

  • Basic calculations such as number of days between two dates, number of months between two dates, etc.
  • Scheduling problems often involve how to determine the fifth business day of the month, the last day of the month, the fourth Thursday of the month
  • Regional or Client-specific concerns include whether certain days are holidays, etc.
  • Week number of the year (ISO: Monday as first day of week, Unix: Sunday as first day of week)
1101 questions
-4
votes
2 answers

Double the current time

I have a query in which I am calculating time. I want to make time double so that if the time is 01:40 then it should become 03:20. Here is my current query SELECT TO_CHAR(TRUNC((ATN_INN-ACT_INN)*24),'09')||':'|| …
Adeel Aslam
  • 1,285
  • 10
  • 36
  • 69
-4
votes
2 answers

Count age in jquery

Hi i want to count my age in jquery. Something like this- Counting my age since, 18 years, 4 months, 2 weeks, 6 days, 5 hours, 17 minutes and 8 seconds The second counter should be running. Is it possible? Thanks.
john
  • 9
  • 1
  • 1
  • 2
-5
votes
1 answer

PHP/SQL Getting first monday and last sunday

Possible Duplicate: php strtotime “last monday” if today is monday? I want to get some information from the database from this current week. So what do i need? The first monday (date) and the next sunday (date). This code works fine, but: $fm =…
Kenny
  • 144
  • 1
  • 2
  • 9
-6
votes
2 answers

How do I fix compiler error: expected '=', ',', ';', 'asm' or 'attribute' before '{' token|"?

I am trying to build a code to calculate capacitance reactance in a simple series capacitive reactor for my electronics class. The purpose of the code is irrelevant, as the problem is that I am doing something very wrong and need help with my C…
Zach Ross
  • 69
  • 1
  • 8
-7
votes
1 answer

Finding Date of Birth given age in months

I'm really stuck with calculating date of birth given a persons age in months. Currently, I'm using C# to do that. However, failed to understand the logic. Thanks in advance
aby
  • 810
  • 6
  • 21
  • 36
-8
votes
1 answer

insert only time in oracle

how to insert only time in hh:mi in oracle and how to run select query by comparing time. Explanation: Let consider a doctor visit in hospital daily from 9AM to 11AM and 6PM to 8PM. SO when we run a select query to search doctors who visit at 10AM…
1 2 3
73
74