Hi,
is there a chance to get only the "month" out of a date field ?
Example: "21.10.2008" should be converted to "10" .
Kind Regards
Holger
Hi,
is there a chance to get only the "month" out of a date field ?
Example: "21.10.2008" should be converted to "10" .
Kind Regards
Holger
var a = "21.10.2008"; // date string format is "dd.mm.yyyy"// convert date string into date objectvar oDate = util.scand("dd.mm.yyyy", a);// display various month formatsconsole.show();console.clear();// get month from date object with zero based month valuevar sMonth = oDate.getMonth() + 1;console.println("Month number: " + sMonth);// get month from date objce with util.printd() method in various displays// month numbersMonth = util.printd("mm", oDate);console.println("Month number: " + sMonth);// short month textsMonth = util.printd("mmm", oDate);// long month textconsole.println("Short month: " + sMonth);sMonth = util.printd("mmmm", oDate);console.println("Long month: " + sMonth);
Here's one:
a="21.10.2008";
myMonth = a.split(".")[1];
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com