Anil's Blog is Best Viewed on GOOGLE CHROME

Wednesday, April 8, 2009

Convert dateToString | stringToDate

Controller Code:-

Date date = (Date)oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("StartDate");
Date edate = (Date)oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("EndDate");

if (date != null && edate != null)
                        String Xs11 = oapagecontext.getOANLSServices().dateToString(date);
                        String Xs12 = oapagecontext.getOANLSServices().dateToString(edate);

In the same way we can convert String to Date


  1. Replies
    1. Hi Anil,

      If I wish to perform the same date conversion in my AM code, how do I get a handle to the oapagecontext?

      From my CO I am calling,

      However I am not able to serialize and send the pageContext param also. Any help is appreciate.


Note: Only a member of this blog may post a comment.