Problem of Flex Date.toUTCString();

I used the date.toUTCString function but the returned result is always one month later than the time I need.
For examle, I used " var date:Date=new Date();
                              var date.setUTCMonth(7);
                               var str:String=date.toUTCString();"
The UTC month value of the date is 7, so the month value in str is supposed to be "July". But I got the value "Aug" in str instead...
So what happended here? Does this related to my system time or browser?

Yep. It's a somewhat inintuitive design decision since it's the only date field that is 0-indexed. My guess is that there is an enumeration of the month names behind the scenes. However, you should learn always check the Language Reference first. Keep it open while developing and you can save yourself some frustration as there is a lot that you can quickly learn about a class once you get used to the layout of the documentation.

Similar Messages

  • FLex Data service

    I run into problem when i create Flex Data Service project. I
    get error when i try to compile my code
    "Invalid byte 1 of 1-byte UTF-8 sequence"
    Doesnt say anything more of what is going on. I tried it both
    on Vista and XP but sometimes project runs and after a while i
    start receiving this error again.
    Thanks in advance

    What about ColdFusion?

  • Flex / Data / Create Application from Database

    Hi, I had a question,
    When I create an application from a Database (Flex / Data /
    Create Application from Database).
    Can I modify the coded to convert it into a module?
    I have a main application that I would like to load the
    Database as a module. I tried replacing the <mx:Application>
    Tags to Module but didn't work...
    Thanks.

    Hi,
    no. no answer as yet. Seems to be a connection issue with the
    Windows 2003 Server, although all the seetings are correct.
    I installed WAMP Server 2.0 locally to see if I can get the
    project running locally, and it works fine. I can connect no
    problem to the MySQL Database on my local PC. I might just have to
    migrate everything over manually once the project is
    complete.

  • Insert problems with Php Data Services

    Hi All,
    I am using Flex Data wizards to create a simple CRUD application and i am having problems adding data. It works the first time i start my application but subsequent calls to the insert fail.
    I am using FB2 Beta with MAMP. The php classes are being generated using the data wizard. i have tried commenting out mysqli_close but still it doesn't work.
    public function createDive_events($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename ( divedate, divesite, divecost, description, totalDays) VALUES ( ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_bind_param($stmt, 'ssdsi', $item->divedate, $item->divesite, $item->divecost, $item->description, $item->totalDays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = mysqli_stmt_insert_id($stmt);
    mysqli_stmt_free_result($stmt);
    //mysqli_close($this->connection);
    return $autoid;
    Any ideas, what i am doing wrong. I have tried using the update and it works only once as well, it seems that the connection to the function is lost after the first call.
    thank you,
    Nayan

    Ok, this is what I got.
    create a mysql table (`people`) with columns id (auto increment), first_name, last_name, age
    in the data/service panel connect to a php service, generate a php service from the database and the people table
    generate a form from the createPeople service call
    observe that in source view we have something like this: <fx:Script>
      <![CDATA[
           protected function button_clickHandler(event:MouseEvent):void {
              createPeopleResult.token = peopleService.createPeople(people);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <valueObjects:People id="people"
                           people_id="{parseInt(people_idTextInput.text)}"
                           age="{parseInt(ageTextInput.text)}"/>
      <peopleservice:PeopleService id="peopleService"/>
      <s:CallResponder id="createPeopleResult"/>
    </fx:Declarations>
    If you now try to execute the code, you will find that you can only insert one person, where each successive addition silently fails.
    There is nothing really wrong with the php code (well actually since it's auto incrementing on id you should pull all id reference out of the insert statements...) rather there is a problem with the flex people object.
    If you make the following changes the code will work
    protected function button_clickHandler(event:MouseEvent):void {
      var myPerson:People = new People();
      myPerson.first_name = people.first_name;
      myPerson.last_name = people.last_name;
      myPerson.age = people.age;
      createPeopleResult.token = peopleService.createPeople(myPerson);
    - e

  • Issues with removing Flex data binding to use Air 14

    Hello,
    I was wondering if anyone had optimal solution for replacing the Flex data binding classes in Air 14. I'm unable to merge the Flex and Air SDK together anymore so all the binding handlers need to be replaced. Has anyone else run into this issue yet? The automated binding generation and handling was the best feature of Flex and now that it's broken it creates huge issues for me.
    This is for Air desktop and mobile applications. They still build just no of the event handling works.
    Cheers,
    Pete

    I had forgotten I solved this myself last Dec. So basically from what I can tell the precompiler no longer does any [Bindable] conversions so you have to manually create the getters and setters for your model when this changes. I hope this helps anyone who may run into the same problem. There's literally no documentation on this any wheres.
    i.e.
    [Bindable]
    public var username : String;
    becomes
    private var _username : String;
            [Bindable(event="propertyChange")]
            public function get username():String
                return this._serviceState;
            public function set username(value:String):void
                var oldValue:Object = this._username;
                if (oldValue !== value)
                    this._username = value;
                    if (this.hasEventListener("propertyChange"))
                        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "username", oldValue, value));
    You also need to make sure what ever class contains this property implements IEventDispatcher and has the following functions:
    IEventDispatcher implementation
    private var _bindingEventDispatcher:flash.events.EventDispatcher =
    new flash.events.EventDispatcher(flash.events.IEventDispatcher(this));
      * @inheritDoc
    public function addEventListener(type:String, listener:Function,
      useCapture:Boolean = false,
      priority:int = 0,
      weakRef:Boolean = false):void
    _bindingEventDispatcher.addEventListener(type, listener, useCapture,
    priority, weakRef);
      * @inheritDoc
    public function dispatchEvent(event:flash.events.Event):Boolean
    return _bindingEventDispatcher.dispatchEvent(event);
      * @inheritDoc
    public function hasEventListener(type:String):Boolean
    return _bindingEventDispatcher.hasEventListener(type);
      * @inheritDoc
    public function removeEventListener(type:String,
    listener:Function,
    useCapture:Boolean = false):void
    _bindingEventDispatcher.removeEventListener(type, listener, useCapture);
      * @inheritDoc
    public function willTrigger(type:String):Boolean
    return _bindingEventDispatcher.willTrigger(type);

  • Problems with Flex 2 beta 3 tutorials

    In the tutorial:
    Build a distributed application with the ActionScript object
    adapter
    the following mxml file is written:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    height="100%" width="100%"
    creationComplete="initApp();">
    <mx:Script>
    <![CDATA[
    import mx.data.DataService;
    import mx.data.events.*;
    import mx.rpc.AsyncToken;
    import mx.rpc.events.*;
    import mx.messaging.events.*;
    import mx.utils.ObjectProxy;
    public var noteObj:Object = new Object();
    public var getToken:AsyncToken;
    private var ds:DataService;
    [Bindable]
    public var noteProxy:ObjectProxy;
    private function initApp():void
    ds = new DataService("notes");
    ds.addEventListener(ResultEvent.RESULT, resultHandler);
    ds.autoCommit = false;
    noteObj.noteId = 1;
    noteObj.noteText = "Type your notes here and share them with
    other clients!";
    getToken = ds.getItem(noteObj, noteObj);
    public function resultHandler(event:ResultEvent):void
    if (event.token == getToken)
    noteProxy = ObjectProxy(event.result);
    ]]>
    </mx:Script>
    <mx:Binding source="log.text"
    destination="noteProxy.noteText"/>
    <mx:TextArea id="log" width="100%" height="100%"
    text="{noteProxy.noteText}"/>
    <mx:Button label="Send" click="ds.commit();"/>
    </mx:Application>
    When I run it, I get the error:
    MessagingError message=Unknown destination 'notes'.
    This destination is correctly specified in the
    flex-data-service.xml
    file (I did not have to change it) which is located at
    C:\fds2\jrun4\servers\default\samples\WEB-INF\flex, which I
    think is the
    correct place for it, but how does flex know which directory
    to use?
    In the default server there is another directory called
    flex\WEB-INF\flex which also contains a (different)
    flex-data-service.xml file.
    I tried the file with the 'notes' destination in it in this
    directory,
    but that didn't work either.
    The complete error message is:
    MessagingError message=Unknown destination 'notes'.]
    at mx.messaging.config::ServerConfig$/getChannelSet()
    at
    mx.messaging::MessageAgent/mx.messaging:MessageAgent::initChannelSet()
    at mx.data::DataConsumer/initConsumer()
    at
    mx.data::ConcreteDataService/
    http://www.adobe.com/2006/flex/mx/internal::reconnect()
    at mx.data::ConcreteDataService/getItem()
    at mx.data::DataService/getItem()
    at tutorials1/initApp()
    at tutorials1/___Application1_creationComplete()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/set initialized()
    Can anyone offer any clues about how the messaging service in
    Flex2
    works and where I might look to try to solve the problem?
    Doug

    Sorry to waste everyone's time. I realized as soon as I'd
    written the
    post that flex knows where to find the file because it has to
    be in the
    same directory.
    Once I moved the files into a tutorials directory in
    C:\fds2\jrun4\servers\default\samples\WEB-INF\flex
    it all worked.
    Pity MM didn't just write that in the tutorial instead of
    talking about
    a 'samples web application' which for newcomers surely is
    meaningless.
    Doug

  • Problem getting correct data from MS Access after doing an Update

    Hi all,
    I have a problem getting correct data after doing an update. This is the scenario
    I am selecting some(Eg: All records where Column X = �7� ) records and update a column with a particular value (SET Column X = �c� ) in all these records by going through a while loop. In the while loop I add these records to a vector too, and pass it as the return value.
    After getting this return value I go through a for loop and get each record one by one from the DB and check if my previous update has actually happened. Since No errors were caught while updating DB, I assume all records are updated properly but my record set shows one after another as if it has not been updated. But if I open the DB it is actually updated.
    This does not happen to all records, always it shows like this
    1st record     Mode = �c�
    2nd record     Mode = �7�
    3st record     Mode = �c�
    4nd record     Mode = �7�
    9th record     Mode = �c�
    10th record     Mode = �7�
    I am relatively new to java and this is someone elses code that I have to modify,So I am not sure if there some thing wrong in the code too
    //Here is the method that gets records and call to update and add to vector
    public static Vector getCanceledWorkOrders() throws CSDDBException{
    //Variable declaration
      try {
        objDBConn = DBHandler.getCSDBCon();
        strSQL  = "SELECT bal bla WHERE [Detailed Mode])=?)";
        objStmt = objDBConn.prepareStatement(strSQL);   
        objStmt.setString(1, '7');
        objWOPRs = objStmt.executeQuery();
        while (objWOPRs.next()) {
         //Add elements to a vector by getting from result set
          //updating each record as PROCESSING_CANCELLED_WO(c)
          iRetVal = WorkOrderDetailingPolicy.updateRecordStatus(objPWODP.iWorkOrderNumber, objPWODP.strPersonInformed, EMSConstants.PROCESSING_CANCELLED_WO);
          if (iRetVal == -1) {
            throw new NewException("Updating failed");
      catch (Exception e) {
        vecWONumbers = null;
        throw new CSDDBException(e.getMessage());
      }finally{
        try {
          objWOPRs.close();
          objStmt.close();
          DBHandler.releaseCSDBCon(objDBConn);
        catch (Exception ex) {}
      //return vector
    //here is the code that actually updates the records
    public static int updateRecordStatus(int iWONumber, String strPerInformed , String strStatus) throws CSDDBException{
       PreparedStatement objStmt = null;
       Connection objDBConn  = null;
       String strSQL = null;
       int iRetVal = -1;
       try{
         objDBConn  = DBHandler.getCSDBCon();
         objDBConn.setAutoCommit(false);
         strSQL = "UPDATE Table SET [Detailed Mode] = ? WHERE bla bla";
         objStmt = objDBConn.prepareStatement(strSQL);
         objStmt.setString(1, strStatus);    
         objStmt.execute();
         objDBConn.commit();
         iRetVal = 1;
       }catch(Exception e){
         iRetVal = -1;
       }finally{
         try{
           objStmt.close();
           DBHandler.releaseCSDBCon(objDBConn);
         }catch(Exception ex){}
       return iRetVal;
    //Here is the code that call the records again
      public static WorkOrderDetailingPolicy getWorkOrders(int iWorkOrderNo) throws CSDDBException{
        Connection objDBConn = null;
        PreparedStatement objStmt = null;
        ResultSet objWOPRs = null;
        WorkOrderDetailingPolicy objPWODP = null;
        String strSQL = null;
        try {
          objDBConn = DBHandler.getCSDBCon();    
          strSQL = "SELECT * FROM [Work Order Detailing] WHERE [Work Order No] = ?";
          objStmt = objDBConn.prepareStatement(strSQL);
          objStmt.setInt(1, iWorkOrderNo);
           objWOPRs = objStmt.executeQuery();
          if (objWOPRs.next()) {
            objPWODP = new WorkOrderDetailingPolicy();
            objPWODP.iWorkOrderNumber = objWOPRs.getInt("Work Order No");
            //......Get Record values
        catch (Exception e) {
          objPWODP = null;
          throw new CSDDBException(e.getMessage());
        }finally{
          try {
            objWOPRs.close();
            objStmt.close();
            DBHandler.releaseCSDBCon(objDBConn);
          catch (Exception ex) {}
        return objPWODP;
      }

    Hello,
    Can you put an example of your problem online?
    Are you sure you're not having problems with case sensitive data?
    Thanks,
    Dimitri

  • Problem with Java Dates and UPDATE for SQL2000

    I am having problems with the date formats for Java. I am trying to put the current date time into a SQL table, here it the code I am using:
    var Today = new Date()
    var conn = Server.CreateObject( "ADODB.Connection" )
    conn.Open( "Provider=SQLOLEDB;Server=(local);Database=BillTracking;UID=sa;PWD=;")
    var sql = "UPDATE BillAssignments SET DatePosted = " + Today + " WHERE AssignmentID = '" + Request.QueryString("AssignmentID") + "'"
    var rs = conn.execute(sql)
    I keep getting different errors and I have been unable to find a solution yet. I know that I need to change the date format from the Java standard to the one that SQL likes.
    Help....
    Norm...

    Please tell us where the Java part of this comes in. I see that you are using JavaScript to load up data via an ADO connection (presumably on an IIS platform) - but I do not see where you are using Java
    Lee

  • Problem with passing date parameters in cursor

    Is there any problem in passing date parameters and like clause as below
    CURSOR eftcursor(start_date DATE, end_date DATE, where_clause varchar2) IS
    select * from r_records
    where created_date between start_date and end_date and description like where_clause;
    and in the open statement
    select to_date('01/06/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into startDate from dual;
    select to_date('01/07/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into endDate from dual;
    str := '%something%aaaaa%';
    open eftcursor(startDate ,endDate , str);
    Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.

    Almora wrote:
    Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.No, your code looks correct -- ou're passing a date to the cursor.
    You might consider whether you really need an explicit cursor though. An implicit cursor is easier to code and performs better.

  • I'm waiting for my new iPhone 5s to be delivered. I lost my iPhone 5 but did have it backed up on my MacBook Pro. I was using iOS6 at the time. Will I have a problem restoring the data to my new iPhone 5s assuming it will come with iOS7?

    I'm waiting for my new iPhone 5s to be delivered. I lost my iPhone 5 but did have it backed up on my MacBook Pro. I was using iOS6 at the time. Will I have a problem restoring the data to my new iPhone 5s assuming it will come with iOS7?

    No, you should not.  There are problems trying to go the other way, but updating a newer iOS release from a backup of an older iOS release has always been supported and is the basic means of setting up a new device from a previous one.

  • HT1296 I have a problem synching calendar data between my iPhone 3GS iOS 5.1 & Outlook 2007 on MS7.  The basic calendar is OK but the birthdays (little box icon) are a day early & cannot be changed to the correct date. How can I fix this?

    I have a problem synching calendar data between my iPhone 3GS iOS 5.1 & Outlook 2007 on MS7.  The basic calendar data transfer is OK but the birthdays (little box icon) are a day early & cannot be changed to the correct date. The birthday entries in my Outlook contacts have correct dates.How can I fix this?

    The following peocess corrects the calendar entry:
    edit the contact & change the birthday, save the change; edit the contact & change the birthday to the correct value, save the change again. The calendar entry then displays on the correct date.  Alternatively as a temp solution I can just de-select the "birthdays" calendar which stops the icon being displayed.
    Thanks for your advice, I think that it's n going to be a slow process to fix all the entries for not much return.

  • Problem while retrving data from a view

    Hi Friends
      i have a problem while retriving data from a view <b>v_t685a</b>.
    the error message is :""" "V_T685A" is not defined in the ABAP Dictionary as a table, projection view or database view."""
    i wrote : select single VTEXT1 from V_T685A into w_cst_jin1 where
                        KSCHL = 'JIN1' and
                        KAPPL = 'V'.
    how to retrive the data.
    waiting for quick response
    Regards
    Mukesh

    Hi
    This is a Maintenance View, not a Database View
    SO can't fetch data using select statement.
    You can use the Table <b>T685</b> directly to fetch the condition Types data straight away instead of the view. write the same select for this table and use.
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • Error while creating New flex data services project

    Hi
    Error: Invalid server root. flex-config.xml or
    flex-enterprise-services.xml must exist in the WEB-INF/flex folder
    within the server root.
    Trying to create flex data services project with Weblogic8.1
    as the j2ee server, but am geting the above error in the screen
    where i point to the root of the server.
    I did deploy flex on weblogic.
    I would appreciate any help.
    Thank you
    Sun

    Hi Nj,
    Thanks for you reply, I did point root folder to WEB-INF
    folder(which contains flex folder). My WEB-INF folder is in the
    weblogics "c://bea/userprojects/applications/appname/"
    this the value in the root folder field "
    C:\bea81SP5\user_projects\applications\dcgsaApplication\dcgsAdaptersWeb\WEB-INF\flex"
    Let me know if am doing anything wrong.
    thank you
    sun

  • Urgent: Problem opening a data form that uses a smart list

    Hi, we've got a problem with a data form that is quite unusual.
    The data form was working perfectly until yesterday when we put a smart list in it. The smart list is composed of 8 possible choices activated by the following member formula:
    IF (SML==1)
    ((BDG->BegBalance->&CurrYear)/12);
    ELSEIF (SML==2)
    ((INC_BDG->BegBalance)*("01A2"->ACT_FINAL));
    ELSEIF (SML==3)
    ACT_FINAL->&PreYear;
    ELSEIF (SML==4)
    (INC_ACT->&PreYear)*("01A2"->ACT_FINAL);
    ELSEIF (SML==5)
    ACT_FINAL;
    ELSEIF (SML==7)
    (INP_PER)*("01A2"->ACT_FINAL);
    ELSEIF (SML==8)
    INP_ASS;
    endif;
    Initially we tested the functioning of every different choice in the smart list and it was working properly. After a while we tried again to change the choices combination and we couldn't open the data form due to an error.
    It is quite strange because sometimes it work and sometimes it doesn't. In the data form (that is very large) there are many accounts and scenarios that are dynamic calc, in addition to the smart list formula; we tried to open the form two minutes ago converting the data storage type of a scenario from "Dynamic calc" into "Dynamic calc and Store", and it seems to work at the moment... does planning have a memory limit? Can someone suggest a solution (or help us find out the reason)?
    Bye

    Anton,
    new thread is one possibility, but the messsage box is not win message box, but SAP form, so I think you can clcik there without new thread too.
    Check this thread, hope it helps
    Re: Confirmation Dialog in my way

  • Problem with billing date at closed period

    Hi
    We have a problem with billing date in transaction . Previously we could set up different (earlier) billing date than the actual posting period and now it is not working. We receive an error message that the posting period is closed ) .
    I attached an example invoice which we managed to post and where you can see what Iu2019m thinking about, parking number: 1024337, BILLING DOCUMENT: 841835. In this case the billing date was at 30.11.2007, but the posting in 15.07.2008 and we managed to post.
    Pls help that issue
    yps

    hi,
    it is due to posting period closed for the month of 07/2008.
    u need to open posting during that period.
    Regards,
    Greeshma

Maybe you are looking for

  • Composite AV connector stopped sending video

    my composite AV connector stopped sending video.......  audio still works but NO video.  I even exchanged the cable for new one.  Any advise??

  • Variable Currency

    Hi Experts, I want to know ,How Can I use "RSW_CURRENCY_TRANSLATION" function in Formula variable customer exit. My currency conversion key is "ZXXX" which takes CAD as Source,GBP as Target based on 0CALMONTH. I am confused,How can I give ,Import ,Ex

  • How can I get properties from my ldap server?

    urgent,I don't know how to use the getproperties to get the properties from ldap server,anyone help?

  • My Macbook won't get past the start up screen

    Hey everyone I have a Macbook that's about 3 years old. I did an software update yesterday and since doing it the computer won't get past the start up screen. There's just the Apple logo and the rolling ball thing. It's been stuck there for around 30

  • Compatibility extension for new Mac photos app?

    Having just updated iPhotos to the photos app on my Macbook pro, I've just discovered there's no drag and drop function any more into both Lightroom and PS. According to the Apple forum, it requires an extension from the third party, i.e.. Adobe to m