Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Date construction in script : DateFormat

  • 1.  Date construction in script : DateFormat

    Posted 03/19/09 07:00 PM

    Originally posted by: SystemAdmin


    [dgravot@noos.fr said:]

    Hello

    I'm constructing a date from an excel file, reading the excell cell as a string and use the Date constructor in a script :

    In Excel, the original date looked like  dd/mm/yyyy hh:mm
    For instance 10 March 2009 was stored as the string 10/03/2009

    OPL expects a mm/dd/yyyy hh:mm format for the Date constructor. I tried to apply the same format of my Excel cell, but although the display changed correctly, the string is still read as "3rd  October 2009" by OPL.

    As a workaround, I had to change directly the date format of regional settings. Then the cell content in excel is correctly read.

    Is it on the road map of OPL  script to construct date with a given date format ?

    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Date construction in script : DateFormat

    Posted 03/26/09 10:02 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    David,

    In case it helps, just a reminder that you can construct dates with year, month, day if you have them as individual numbers that you parsed by yourself.


      var d = new Date(2009, 3, 25);


    Didier.
    #DecisionOptimization
    #OPLusingCPOptimizer