473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Add the Day to the Existing Date

I am facing a problem to add the days with the existing date

ex text field 1== 29/11/2006

Add day = 10 days

I am getting the output as 39 / 11 / 2006


but i need the result as == 9/12/2006 in another text box

Please help me in javascript
Nov 29 '06 #1
12 6700
r035198x
13,262 8TB
I am facing a problem to add the days with the existing date

ex text field 1== 29/11/2006

Add day = 10 days

I am getting the output as 39 / 11 / 2006


but i need the result as == 9/12/2006 in another text box

Please help me in javascript
Post the code you are using that is giving the problem
Nov 29 '06 #2
AricC
1,892 Expert 1GB
I am facing a problem to add the days with the existing date

ex text field 1== 29/11/2006

Add day = 10 days

I am getting the output as 39 / 11 / 2006


but i need the result as == 9/12/2006 in another text box

Please help me in javascript
If you add 10 to 29 you get 39. Why wouldn't you expect that?
Nov 29 '06 #3
Post the code you are using that is giving the problem
Hello Gentle man,

I need the answers, i don't need the questions, If u know the answer replay
and help me sir,
Y r u wasting ur time and ur thinking power.

" I opened with smile. but, i got frestrated" Please don't do like this sir,

If any thing wrong forgive me.

If u know once again help me sir.

Any way thanks sir,
Frankline jose
Nov 30 '06 #4
If you add 10 to 29 you get 39. Why wouldn't you expect that?
Hello Gentle man,

I need the answers, i don't need the questions, If u know the answer replay
and help me sir,
Y r u wasting ur time and ur thinking power.

" I opened with smile. but, i got frestrated" Please don't do like this sir,

If any thing wrong forgive me.

If u know once again help me sir.

Any way thanks sir,
Frankline jose
Nov 30 '06 #5
r035198x
13,262 8TB
Hello Gentle man,

I need the answers, i don't need the questions, If u know the answer replay
and help me sir,
Y r u wasting ur time and ur thinking power.

" I opened with smile. but, i got frestrated" Please don't do like this sir,

If any thing wrong forgive me.

If u know once again help me sir.

Any way thanks sir,
Frankline jose
The moment you post the code you have so far, you will be surprised how much help you will start getting.
Nov 30 '06 #6
one text box contain == 15/10/2006 (dd/mm/yyyy)

in next text box contain == 30 (dd ) (day only)


what will be result in another text box = 14/11/2006 (dd/mm/yyyy)

[give code for this program in javascript]
Nov 30 '06 #7
r035198x
13,262 8TB
one text box contain == 15/10/2006 (dd/mm/yyyy)

in next text box contain == 30 (dd ) (day only)


what will be result in another text box = 14/11/2006 (dd/mm/yyyy)

[give code for this program in javascript]

This does not make any sense.
Nov 30 '06 #8
The sample code

myDate=new Date();

myDate.setDate(myDate.getDate()+10+365)

document.write(myDate);



The out put will by 12/dec/2006
Dec 2 '06 #9
AricC
1,892 Expert 1GB
Are you trying to add dates but finding out that sometimes when you add dates the result is a date that isn't legit? Like 35/12/2006?
Dec 2 '06 #10
mrhoo
428 256MB
Expand|Select|Wrap|Line Numbers
  1. function addDays(){
  2. var t1='15/10/2006' // get input value
  3. var t2= '35'; // get input value
  4.  
  5.     var A=t1.split('/');
  6.     var N= parseInt(t2)*86400000;
  7.     A[1]-=1;
  8.     var D=new Date(A[2],(A[1]),A[0]).getTime();
  9.     D=new Date((D+N));
  10.     var str= D.getDate()+'/'+(D.getMonth()+1)+'/'+D.getFullYear();
  11.     return str // or set a text area value= str
  12. }
/*
Note- Get your values (t1,t2) from the input field values

Date() references months starting with 0 for january, 11 for december
if you don't subtract 1 from the user entered month you can get Nov 31 instead of Dec 1

This is an easier ( and internationally friendlier) way to display the date string:
var str= D.toLocaleDateString();

*/
Dec 3 '06 #11
I am trying to answer if its not too late
Nov 13 '08 #12
acoder
16,027 Expert Mod 8TB
I am trying to answer if its not too late
It's been nearly two years, but it's never too late to answer.

It had already been answered in another thread which I've now merged with this one, but post your proposed solution anyway. Every bit of good help is appreciated by all I should think.

PS. welcome to Bytes!
Nov 13 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: marcum williams | last post by:
Finding absolutely no documentation for updating existing projects on a remote server using Web Setup Projects. Any help would be much appreciated. thanks
4
by: Raffi | last post by:
I need to do the following: From the main page I click a link button and open a javascript popup window. So far so good. Now when i try to open a new popup window from a button link in the first...
0
by: dave jackson | last post by:
Hi, I'm formatting fields when creating my view and would like to reuse the existing labels. e.g. Create View TEST AS SELECT AMOUNT, CURRENCY, DIGITS(CUSTNO) AS PADCUSTNO, DATE(DAYNO) AS...
4
by: sunilkeswani | last post by:
I need help with exporting data from 2 access tables, into 2 existing spreadsheets in a single Excel file. Currently, I am using this code: DoCmd.TransferSpreadsheet acExport, 8, "Table1",...
7
by: Andy Bates | last post by:
I have hopefully a simple problem in C#. I designed a form with a listview on left, vert splitter against that, then the remainder of the form from top to bottom: a listview, horiz splitter and...
0
by: chrislearner | last post by:
Hi All, I am new to this group and urgently require help from you guys!! I have to hard code the START date and the END date to 04/01/2006 and 06/30/2006 respectively. Here's the existing sql...
1
by: ShadesOfGrey | last post by:
Hello again. Thanks to Gord, I have this cool query that puts my student attendance records in a calendar format in Access 2003. PARAMETERS Text ( 255 ), IEEEDouble; TRANSFORM...
3
by: PerumalSamy | last post by:
Hi I am developing a project in asp.net using vb coding. I need to add days/weeks/months to existing date in asp.net. Ex: existing date : 24/10/2007 Add : 10 days or 2 weeks...
16
by: scoots987 | last post by:
Hi all, I have an existing table(Several actually) that I want to add a column or two or three. I need to have, I think, at least two columns. One for Created date and believe this is a no...
8
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I have some code (given to me), but I don't know alot about ASP, so I was hoping someone here can help. Running on Win 2008 server. The code below will scan a folder and subfolder...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.