[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Date issue with java script

Posted on 2011-09-11
5
Medium Priority
?
203 Views
Last Modified: 2012-05-12
Hello all I am getting this value 15_D which has a date format. I am placing into a var ret22 and I would like to keep in ret22 with a diffrent format. The currect format is gives me is •MM/dd/yyyy
. I would like to cahnge to •MMMM dd, yyyy

PLease advise what I have to do. Thanks
var ret22 = this.getField("15_D").value;
0
Comment
Question by:eteran
  • 3
  • 2
5 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36519905

What this has to do with Java Programming Language?

And which date it is - is it !5th of December ?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36520009


You can look at thios date function for formatting date in hjava script:
http://stevenlevithan.com/assets/misc/date.format.js

and description of how to use is here:

http://blog.stevenlevithan.com/archives/date-time-format

But still it is good to know what is "15_D" ?

0
 
LVL 83

Accepted Solution

by:
leakim971 earned 1500 total points
ID: 36520261

var ret22 = this.getField("15_D").value;

var months = [ "January", "February", "March","April","May","June", "July","August","September", "October", "November","December"];
var arr = ret22.split("/");
ret22 = months[ parseInt(arr[0]) ] + " " + arr[1] + "," + arr[2];

Open in new window


A good article about date : http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_484-Can-I-have-a-date.html
Don't forget to vote ;-)
0
 
LVL 83

Expert Comment

by:leakim971
ID: 36520265
@for_yan

We're in Acrobat Javascript world :
15_D is a field in a PDF Form
http://wiki.scribus.net/canvas/How_to_enhance_your_PDF_forms_with_JavaScript
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36520270
I see. Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question