Using CRA java functions

Unanswered Question
Aug 16th, 2007

Hello. I have CRA ver 3.1(2)

I want to get curent date information using java function getDate(). I can't figure out how it works. It returns integer value. When i saved this value in database i saw that it was zero.

Where can i get more information and examples of using java function like setSeconds and other?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
sferland Thu, 08/16/2007 - 04:21

First, you need a "Date" variable.

Then, with the help of a SET step, you call the date constructor.

Ex: SET my_date = new Date()

At this point, the variable "my_date" will contain the current date and time. It is now easy to extract the year, the month, the day, the hour, etc. using the methods associates with a "Date", like .getMonth().

Hope this help.

Please rate helpful post.


Voland8315 Thu, 08/16/2007 - 07:45

I can't do that in the SET step. The properies of this step are Variable and Assign.

I set variable = my_date( which is Date type)

and write - new Date() - in the property assign.

This call an error. I set step "Create java object", and run java methods getMonth and other . I figured out why this did not work. When i simply upload the new script in the place of old version it did not work correctly. When i fully deleted old version of the script and then uploaded the new - it fixed the problem.

sferland Fri, 08/17/2007 - 04:31

Oups ! Sorry, I did not see that you was talking about version 3.1(2).

My post was referring to version 4.


This Discussion