English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Oracle/PLSQL: Add_Months Function
--------------------------------------------------------------------------------
In Oracle/PLSQL, the add_months function returns a date plus n months.

The syntax for the add_months function is:

add_months( date1, n )

date1 is the starting date (before the n months have been added.

n is the number of months to add to date1.

For example:

add_months('01-Aug-03', 3) would return '01-Nov-03'

add_months('01-Aug-03', -3) would return '01-May-03'

add_months('21-Aug-03', -3) would return '21-May-03'

add_months('31-Jan-03', 1) would return '28-Feb-03'

2007-05-17 15:08:52 · 2 answers · asked by nick 1 in Computers & Internet Programming & Design

2 answers

I think this is what you are looking for.
Calendar.add();
to add one month to a date
Calendar c = Calendar.getInstance() ;
c.add(Calendar.MONTH, 1) ;

2007-05-17 21:14:30 · answer #1 · answered by AnalProgrammer 7 · 0 0

i don't think there is any equivalent, although it wouldn't be difficult to write a one. should take you less than 10 mins to write a function of your own

2007-05-17 22:52:33 · answer #2 · answered by sentinels_of_evil 1 · 0 0

fedest.com, questions and answers