Question about Microsoft Computers & Internet

1 Answer

Who to manuplate the date in java

I have to read the system date and i will increment date to 10 or 15 days
the data format will be like this
13/3/1985

please any one guide me to solve this problem

Posted by on

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Mentor:

    An expert who has written 3 tips or uploaded 2 video tips.

    Governor:

    An expert whose answer got voted for 20 times.

  • Expert
  • 80 Answers

Date arithmetic is relatively easy if you remember that time in JavaScript is measured in milliseconds. Use the date method getTime() to determine the number of milliseconds that have elapsed since the magic date of January 1, 1970. Use the setTime() method to establish a date you have calculated in term of milliseconds.

Danny Goodman, author of the JavaScript bible recommends that you set up some variables that build on each other to make it easier to do Date Arithmetic. Here is the variable setup that he recommends:

var oneMinute = 60 * 1000 // milliseconds in a minute
var oneHour = oneMinute * 60
var oneDay = oneHour * 24
var oneWeek = oneDay * 7

So for your case (date for 10 days after today), we can declare like this:

<SCRIPT language="JavaScript">

var today = new Date();
var mm= today.getMonth();
var dd = today.getDate();
var yyyy = today.getFullYear();
var oneMinute = 60 * 1000; // milliseconds in a minute
var oneHour = oneMinute * 60;
var oneDay = oneHour * 24;
var dateInMS = today.getTime() + oneDay * 10;
var TargetDate = new Date (dateInMS)
document.write("Today is: " + mm + "/" + dd + "/" + yyyy);
document.write("<br />");
document.write("10 days after today is: " + TargetDate);

</SCRIPT>


P.S.: If this information was helpful, please rate this solution.

Posted on Mar 12, 2009

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to correct error code 4 in 10 on Sharp pocket computer pc-1270


I found the answer for the PC1500, and I'm guessing the error codes for the PC1270 will be similar. Here is what the manual says:

This error occurs when there is no DATA corresponding to a READ command, for example:
10 READ X, Y
20 DATA 10
30 END
The display will say, "ERROR 4 IN 10"

The solution is to provide enough DATA to satisfy the READ. For example, change line 20 to read as follows:

20 DATA 10,15

Hope this helps.

May 04, 2017 | Sharp Office Equipment & Supplies

1 Answer

I have Timex SR 920 SW watch, how to adjust the date and day?


Adjust the day of month (1-31) by pulling the crown pin out part way, and turning the pin counter clockwise, incrementing the date arm. Counterclockwise does nothing.

To adjust day of week (Mon-Sun), pull the pin out and rotate to turn minute/hour hands. Each time you pass 12:00, the weekday hand will increment by a half step.

May 01, 2011 | Timex Analog Metal Field 40051 Watch for...

1 Answer

No sound


For no sound, if you have the cd driver of your motherboard then re-install it to update and fix the hardware error. If you do not have the cd driver, you have to read your motherboard brand and model then download the driver from their official with compatible audio driver to your operating system. If you installed it properly but still the same no sound, try to remove the battery on your motherboard for about 10 seconds then put it again the battery then turn on your computer then press F2 or DEL key to change the system date and time. Check for audio again and still no audio or no sound then format your computer but you must back up your data or files first because when formatting it will erase the entire data or files within that partition. Have a nice day.

Mar 11, 2011 | Computers & Internet

1 Answer

Please help am going to get fired lost company data while i was formatting it,how can i retrieve the data?am using apire 5332


every pc has an option of restoring datas..
START menu->->All programs->Accessories->System Tools->System restore->
Then its user friendly . Jus follow the instructions and restore your pc to the earlier date frm the date u formated it.
Good luck

Dec 22, 2010 | Computers & Internet

1 Answer

Got casio qt2000 till, using hospitality 1.35 build 181. Single connection to PC com3:, no printers terminal only and cash draw. Simple single bar senario, Drinks, Read takins and item groups at end...


I think you enter date in std Casio format: PGM1 mode, Type YYMMDD then press X/TIME button
If you go to Z mode and try a report, what happens?
---------------------------------------------------------------------------------
If anyone needs a manual for a Casio QT-2000, C-tech collective have User/ Programming, service manuals here: http://the-checkout-tech.com/manuals/cashregisters/Casio3.php

Dec 01, 2010 | Casio Parts Cash Register PC Desktop

2 Answers

How to install opera browser in samsung mobile


download operamini from internet in .sis file format..and then send it to your phone using samsung PC studio...which comes with it in a Cd...

Oct 17, 2010 | Samsung S3500i Cell Phone

1 Answer

How do i reset date on my partner 18D


Changing the date on a Partner system is done on either ext 10 or 11.
At one of those ext's press the feature key and "00"
next press the left hand intercom twice
the display should say system programming
enter in "#101"
the display should say system date and the current data in mm,dd,yy format
enter the new date month, day then year
press feature "00" to logout

Sep 07, 2010 | Lucent PARTNER18 Corded Phone

1 Answer

How do I reset the Date and Day of the Week on the display of my Avaya phone?


The day program was taken out on newer models of Partner systems where it uses the date to figure out the day of the week.

Changing the date on a Partner system is done on either ext 10 or 11.
At one of those ext's press the feature key and "00"
next press the left hand intercom twice
the display should say system programming
enter in "#101"
the display should say system date and the current data in mm,dd,yy format
enter the new date month, day then year
press feature "00" to logout
If you have an older model Partner system,you'll also have to enter in the day of the week in programming
Press the feature key and "00"
next press the left hand intercom twice
the display should say system programming
enter in "#102"
the display should say system day and the current programmed info
enter the new day, 1= sun, 2= mon, etc.
press feature "00" to logout

Jun 25, 2010 | Avaya 700340193 Corded Phone

1 Answer

How can i export Tally Data to Excel


when u give the print commant u get an export button on the right side. Press that button and then then selest the rewuired format. XML is the genaralised format used these days. Then import the data in tally

Apr 30, 2009 | Tally T2245 Matrix Printer

1 Answer

Pls hepl me wit Excel VB integration


you can use a OLE object that is available in VB as standard object. Drag the tools to your form that your creating and it will ask for create or link existing object. so now browse to the excel sheet and embed it into the VB form or use run time for manuplating the cells and other info in excel.

Mar 25, 2008 | Computers & Internet

Not finding what you are looking for?

Open Questions:

Computers & Internet Logo

Related Topics:

335 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2644 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18381 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...