08-16-2007 01:56 AM - edited 03-14-2019 01:11 AM
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?
08-16-2007 04:21 AM
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.
Steven
08-16-2007 07:45 AM
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.
08-17-2007 04:31 AM
Oups ! Sorry, I did not see that you was talking about version 3.1(2).
My post was referring to version 4.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide