Date conversion variable number

I could do this using javascript, but I wanted to do this through if possible liquid so I can use it in more liquid logic. I want to reach adds a number of hours at a variable 'date' and have the date calculated, if I worked in PHP I would use something like a UNIX time however I can't find an equivalent to work in British Colombia.

For example say I have today dateTime variable " 2015-10 - 01 T 13: 02:33" I want to add 1,000 hours to what is about 42 days putting us around November 11, I can't quite understand how to achieve this, if I were to do something like {{globals.site.dateNow |}} "" date: "YYYYMMDD" | {{more: days-}}, where days = {{1000 | dived_by: 24 | cleli}} this will work until we had to move from October to November, in this example I'd end up with a variable that was closest to the 43rd October which obviously isn't quite right.


I think the key is in making the date as a total number of hours, or by converting the 1000 hours in a dateTime variable valid to add to the Start date however after bother for a few hours, while going through the Developer Referencedocumentation, I can't quite work as it should. Any help would be appreciated.

Read this:

Liquid data types

That should help

Tags: Business Catalyst

Similar Questions

  • Problem transforming any XML data to a number of

    Ask for help, I am trying to transform XML data into a number that I can use in formulations to animate. It is a simplified example of what I'm trying to do. I have successfully comes from the xml file info in the text on the stage. My problem is that I need to have value data imported to be a number so that I can do with her future calculations, such as adding two numbers together to create a new variable total. I have accumulated my brain reading on XML data, has spent several days trying obvious solutions without result, and yes I'm new on even though I tried many encoding options.

    Thank you, Cindy j..

    -IMPORT of ONE XML FILE "textimport.xml".

    <? XML version = "1.0" encoding = "UTF-8"? >

    < mediansaleschart >

    < figureone > 20 < / figureone >

    < figuretwo > 10 < / figuretwo >

    < / mediansaleschart >

    -EDGE ANIMER CODING scene/creationComplete

    $.ajax({)

    type: 'GET ',.

    URL: "textimport.xml",

    data type: "xml."

    success: {function (xml)}

    textOne = $(xml).find('figureone').text ();

    textOneTxt.html (textOne);

    textTwo = $(xml).find('figuretwo').text ();

    textTwoTxt.html (textTwo);

    }

    });

    var textOneTxt = $(this.lookupSelector ("textOneTxt"));

    var textTwoTxt = $(this.lookupSelector ("textTwoTxt"));

    -EDGE ANIMER OF ELEMENTS ON THE STAGE, text elements

    textOneTxt

    textTwoTxt

    To get the value of the xml node, you must use parseInt.

    So for the total, I did something like this

    myTotal = parseInt (figureone) + parseInt (figuretwo);

    You should also make use of the last reference of research

    Instead of

    $(this.lookupSelector ("textOneTxt"));

    Use this notation

    sym.$("textOneTxt");

    Here's an example - http://www.heathrowe.com/edge/xmlnum/

    Download - http://www.heathrowe.com/edge/xmlnum/xmlnum.zip

    Code on compositionReady.

    var figureone, figuretwo, myTotal;
    var outputField = sym.$("xmlOutput");
    var messageString;

    $.ajax({)

    type: 'GET ',.
    URL: "sampleoutput.xml",
    data type: "xml."
    success: {function (xml)}
    figureone = $(xml).find('figureone').text ();
    figuretwo = $(xml).find('figuretwo').text ();
    myTotal = parseInt (figureone) + parseInt (figuretwo);
    messageString = "Figure a single value is:" + figureone + "
    "
    Figure two value is: "+ figuretwo +".
    "
    The total value is: "+ myTotal;

    outputField.html (messageString);
    }
    });

    ///////////////// End Code ////////////////////////

    HTH

    Darrell

  • With a variable number of input ports on a Subvi

    How can I have a Subvi with a variable number of input ports that can be changed in the other VI that uses the Subvi?

    You can't actually do what you trying to do, how LabVIEW is implemented does not screw created by the user with arbitrary entries.  And to be honest, there is probably a better way to do whatever it is you want to do.

    If you really really want to do that, but... you can come kind of close.

    1. create a new VI

    2. change its connector to the one with the inputs and outputs pane more possible (terminals 8-6-6-8, 28)

    3 create controls/indicators for any desired input/output of not scaling can connect the (i.e. the error in / error, son of reference, etc.)

    4. hang them until the connector pane

    5 count how many entries are left and create a control for each entry and their son all

    6 drop your VI on the block diagram of the VI one another as a Subvi

    7. Note that when you mouseover, it looks like a Pincushion

    8. right click the VI and uncheck the "display as icon".

    9. you can now "slide down" at the bottom of the VI

    The terminals in the section "slide down" are as a package by name or node property that you can click on them to reallocate them to what it is not already selected.  The default is to make all the entries in alphabetical order, then all the outputs in alphabetical order.  If you rename the terminals that allows you to make appear in the order that you prefer is up to you.

    As all terminals, for the best that you can do to detect if they are wired is to define a default value that should never be used.  If she is floating points, you can use 'NaN' or 'Inf '.  If this is a cluster that you did, add an item more boolean which is true in the default values for this entry VI.

    Then just wire up all the identical terminals together in a table, filter the items which appear to be unwired and make all your treatment on the rest.

  • Variable number of objects detected in Calculator handling VBAI

    I have an inspection looking for shiny objects (holes) in a product, and in general it is not all (good), but when he does I need to know the location of each hole, to determine the xy-limits of the area of holes, that is, the minutes and culminates each hole xy coordinates. To do this, I would use a stage of caclulator and iterate through all of the holes found... but I don't think that the calculator can handle a variable number of holes... or it can?

    Thank you

    Eric

    Hi Eric,.

    Step of the calculator does not support tables. We have had many requests on the better table support in VBAI and we are going to solve it.

    In the meantime, you can browse the results of a step that produces berries by building a state diagram a bit more complex. Index Example.vbai measures and classify objects Example.vbai for examples on how to do it.

    I hope this helps.

    Best regards

    Christophe

  • dynamic double bit data conversion

    It could be very simple, but I was confused. I have current data and average data as in code. I want to build the table using these data, save them on my hard drive and open in word with header (current and average)

    Problems:

    I have data from two sources in lead generation and versions table as shown entry table to write on the worksheet vi. I get the error source is dynamic and double sink is a bit. It is the most difficult part of my life to find out what range of conversion to use.

    When I run the vi (lets assume the good range of conversion is connected and there is no conversion error) pops up the dialog for path that comes up constantly on dialog

    Ideally I want appears on the screen when I press on would go so that I can browse location to save the file, and once the path is specified vi works continuously and the data is written to the worksheet while vi is running.

    Thanks a lot for reading and help

    See you soon

    Welcome to the evil world of dynamic data. What you really want to use is the merging of signals feature. When you do this a dynamic data conversion will be automatically added between the signals to merge and writing on a spreadsheet file.

    You can consider using writing to the file position as directly accepts dynamic data.

    With respect to the path, use a shift register.

  • Invalid reference to the variable 'NUMBER '.

    Hi gurus

    I understand that if someone helps me, I have the following code example.

    Code example

    SET SERVEROUTPUT ON

    DECLARE

    List_of_numbers_t TYPE TABLE IS NUMBER;

    l_numbers list_of_numbers_t: =.

    list_of_numbers_t (1,2,3);

    BEGIN

    DBMS_OUTPUT. Put_line (l_numbers (1).) (COUNT);

    END;

    Error

    Error report:

    ORA-06550: line 7, column 38:

    PLS-00487: Invalid reference to the variable 'NUMBER '.

    ORA-06550: line 7, column 3:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    * Action:

    I want to check the index 1 of my collection, but I get the above error. Can someone help me to remove this error. Thank you

    Concerning

    Matt


    Hi, Matt,

    Matt. wrote:

    Hi gurus

    I understand that if someone helps me, I have the following code example.

    Code example

    SET SERVEROUTPUT ON

    DECLARE

    List_of_numbers_t TYPE TABLE IS NUMBER;

    l_numbers list_of_numbers_t: =.

    list_of_numbers_t (1,2,3);

    BEGIN

    DBMS_OUTPUT. Put_line (l_numbers (1).) (COUNT);

    END;

    Error

    Error report:

    ORA-06550: line 7, column 38:

    PLS-00487: Invalid reference to the variable 'NUMBER '.

    ORA-06550: line 7, column 3:

    PL/SQL: Statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    * Action:

    I want to check the index 1 of my collection, but I get the above error. Can someone help me to remove this error. Thank you

    Concerning

    Matt

    The collections have some counts; scalars don't.

    l_numbers is a collection, so you can see the number of items contained in it like this:

    DECLARE

    List_of_numbers_t TYPE TABLE IS NUMBER;

    l_numbers list_of_numbers_t: =.

    list_of_numbers_t (1,2,3);

    BEGIN

    DBMS_OUTPUT. Put_line (l_numbers. (COUNT);

    END;

    /

    l_numbers (1) , however, is just a scalar NUMBER, you can't use COUNT on it

    In other words, l_numbers (1) is the number 1, so we can not say

    DBMS_OUTPUT. Put_line (l_numbers. (COUNT);

    for exactly the same reason that you can't say

    DBMS_OUTPUT. Put_line (1. (COUNT);

  • incompatible data types: expected NUMBER got LONG

    Version 3.2.20.09

    Hello

    I use SQL Developer and want to see trigger body using as a function but unfortunately its data type is long so that I get the error message, is there a way by which I can see the bodies of trigger...

    Example query

    TRIGGER_BODY

    SELECT TRIGGER_BODY FROM user_triggers

    WHERE TRIGGER_BODY LIKE '% HEAR. "

    Error

    ORA-00932: inconsistent data types: expected NUMBER got LONG

    00932 00000 - ' incompatible data types: wait %s %s got. "

    * Cause:

    * Action:

    Error on line: column 2: 7

    This isn't a matter of SQL Developer.  Access quick, but partial, the answer is that the display of a LONG column in SQL * more / developer SQL can be done by issuing just one

    1000 long - value (or some other, more)

    You are referencing a LONG in a WHERE clause, however, is absolutely forbidden as I know.  Maybe something new (System invisible columns generated in LONG columns in the data mirrored dictionary?) are available in 12 c, but disapproval of LONG was announced in Oracle 8 in favour of the LOBs.

    Anyway, if you do not want to ask this question in the forum of PL/SQL, see solution code of Laurent Schneider in this old debate...

    Search long data type in the column

  • Insert the ROWNUM in a column of data type of NUMBER table

    Hello

    I have a table that has a column named "rank" of the NUMBER data type. Basically, I want to make an analysis of top-n and insert the ROWNUM with other columns in the table.

    Definition of table1:

    CREATE TABLE

    (

    col1 VARCHAR2 (10),

    Col2 NUMBER,

    NUMBER of col3,

    rank NUMBER

    );

    INSERT INTO table1

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum < = 5;

    I get an error ORA-01722: invalid number. I think the mistake is virtual ROWNUM is not data type of NUMBER, so I tried to cast as CAST (ROWNUM AS NUMBER), but it does not work, same error. Can can you please shed some light on how to convert a ROWNUM number or if the issue is something else.

    you're right, your example worked. It is an example of table I just created just to illustrate the problem, but my real table was always showing the same problem. Weird, isn't? However when I added the column names after that insert the question but statement I resolved. Adding code

    INSERT INTO TABLE1

    (col1, col2, col3, rank) - added

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum<=>

    So that means ROWNUM returns number; and another confusion: why the inclusion of the column has solved my problem when it is not necessary for your example. in any case thank you.

  • DATE to the number

    Hello
    How to convert a date as a number.

    as

    Select (sysdate) to_number of double

    Select To_number (to_char (, 'DDMMYYYY')) of double;

  • MX:box as ItemRenderer and data of variable height

    Hello

    I have a component mx:List that displays a value object instances and uses an element converter to display the data in the list. The rendering engine is derived from a mx:Box.

    The problem occurs when the data to display a variable height (data may have 0 to many pieces of additional data that are associated and are displayed using a mx:Repeater in the renderer). I can't get the mx:Box to have a dependent variable height of the size of the data that it contained. I tried "height ="100% "', that makes no difference and also 'verticalScrollPolicy ="off"', which truncates just the data in the list regardless of the height."

    Is it possible to display data of variable height via an ItemRenderer?

    Thanks for any help.

    Make sure you set variableRowHeight = true on the list.

    The rendering engine is given an explicitWidth and requested to report a height based on this width.  Often, which may require to make a custom Measure [] override, but you can sometimes get away with binding to explicitWidth.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Implicit coercion of a date for a number of unrelated type

    I use the following to select every day of the month displayed on the date picker.

    var start_d:Date = new Date();
    start_d.month = chooser.displayedMonth;
    start_d.date = 0;

    var end_d:Date = new Date();

    find the last day in the month
    var dt:Date = new Date (chooser.displayedYear, chooser.displayedMonth + 1, 0);

    Alert.Show (DT. ToString());
    end_d.month = chooser.displayedMonth;
    end_d.date = 25;
    calendar.selectedRanges = [{rangeStart: start_d, rangeEnd: end_d}];

    I find the last day of the month for day DisplayedMonth + 1 0. If I say 'end_d.date = 25' this code runs to select the day 1 to 25 on the date picker, but I can't make it work with the last day of the month when I do this: 'end_d.date = dt;' I get an implicit constraint of the mistake of a date to a number of independent typoe. So I tried this:

    var df:DateFormatter = new DateFormatter();
    df.formatString = "DD";
    var formattedDate:String = df.format (chooser.selectedDate);
    end_d.date = formattedDate;

    but I get the same error. No idea how to get this latest date to be the last day of the month?

    Try this:

    end_d.date = dt.date;

    SelectedRanges property requires numerical values. DT is a type of Date, but dt.date's number. Here is the test application I used.


    http://www.Adobe.com/2006/mxml"layout ="absolute">

    public function setCalendarRange (): void {}
    var start_d:Date = new Date();
    start_d.month = chooser.displayedMonth;
    start_d.date = 0;
    var end_d:Date = new Date();
    find the last day in the month
    var dt:Date = new Date (chooser.displayedYear, chooser.displayedMonth + 1, 0);
    end_d.month = chooser.displayedMonth;
    end_d.date = dt.date;
    calendar.selectedRanges = [{rangeStart: start_d, rangeEnd: end_d}];
    }
    ]]>



    Vygo

  • Select a specific empty data type variable in a view

    Hello

    I'm creating a view

    SELECT id, seq, null createdate-> need for it to be of data type, null-> need qty is data from table1 number type


    -where table1 has only id & seq and I don't want to create these new 2 fields in the table

    is there a way?

    pls advise

    SELECT id, seq, null createdate--> need is the data type, no Qty

    select id , seq , cast(null as date) createdate, cast(null as number) qty ...
    
  • Giving date based return number interval

    Here is an example of what I am trying to accomplish. The setting I will use is which days are available for work in the format of (0,1,1,1,1,1,0).

    The first digit represents the Sunday and the last is Saturday. If the day was 0 you have to jump that date, but if the date has a 1 you can use this date. So if the data contained an 0 for Monday if will have to jump Monday when days are added. I can find a way to put the SQL set to skip the Saturday and Sunday, but may not know how to use the format (0,1,1,1,1,1,0) to determine if the work is authorized.

    Here's the SQL I use as a concept I need help on how to incorporate it.

    ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
    CREATE or REPLACE function custom_add_days
    (start_date_in date, number of days_in)
    date of return
    IS
    number of v_counter;
    date of v_new_date;
    number of v_day_number;
    BEGIN

    / * This routine adds a specified number of days (ie: days_in) at a date (ie: start_date). */
    / * It will ignore all weekend days - Saturday and Sunday * /.
    v_counter: = 1;
    v_new_date: = start_date_in;

    / * Loop to determine how many days to add * /.
    all in v_counter < = days_in
    loop
    / * Add a day * /.
    v_new_date: = v_new_date + 1;
    v_day_number: = to_char (v_new_date, 'd');

    / * Increment counter if day falls between Monday to Friday * /.
    If v_day_number > = 2 and v_day_number < = 6 then
    v_counter: = v_counter + 1;
    end if;

    end loop;

    RETURN v_new_date;

    Sorry did not see your last post.

    Maybe something like that (changed your function a bit):

    SQL> CREATE OR REPLACE FUNCTION custom_add_days (
      2     start_date_in   DATE,
      3     work_days       VARCHAR2,
      4     days_in         NUMBER
      5  )
      6     RETURN DATE
      7  IS
      8     v_counter          NUMBER;
      9     v_new_date         DATE;
     10     v_day_number       NUMBER;
     11     v_loop_counter     NUMBER := 0;
     12     work_days_status   NUMBER;
     13  BEGIN
     14  /* This routine will add a specified number of days (ie: days_in) to a date (ie: start_date). *
    /
     15  /* It will skip all weekend days - Saturdays and Sundays */
     16     v_counter := 1;
     17     v_new_date := start_date_in;
     18
     19  /* Loop to determine how many days to add */
     20     WHILE v_counter <= days_in
     21     LOOP
     22  /* Add a day */
     23        v_new_date := v_new_date + 1;
     24        v_day_number := TO_NUMBER(TO_CHAR (v_new_date, 'd'));
     25        v_loop_counter := v_loop_counter + 1;
     26        work_days_status :=
     27           TO_NUMBER (SUBSTR (REPLACE (work_days, ','),
     28                              CASE
     29                                 WHEN MOD (v_loop_counter, 7) = 0
     30                                    THEN 7
     31                                 ELSE MOD (v_loop_counter, 7)
     32                              END,
     33                              1
     34                             )
     35                     );
     36
     37  /* Increment counter if day falls between Monday to Friday */
     38        IF  work_days_status = 1
     39        THEN
     40           v_counter := v_counter + 1;
     41        END IF;
     42     END LOOP;
     43
     44     RETURN v_new_date;
     45  END;
     46  /
    
    Function created.
    
    SQL> show errors
    No errors.
    SQL> SELECT sysdate FROM Dual
      2  /
    
    SYSDATE
    ---------
    01-JUL-09
    
    1 row selected.
    
    SQL> SELECT CUSTOM_ADD_DAYS(sysdate, '1,0,1,1,1,0,1', 3) FROM Dual
      2  /
    
    CUSTOM_AD
    ---------
    05-JUL-09
    
    1 row selected.
    
    SQL> 
    

    Kind regards
    JO

    Published by: Joice John July 1, 2009 06:08

  • AM Customer Interface + method with a variable number of parameters

    Hello

    I use JDev11 & ADF. I have an App Module exteding, an application custom module (ApplicationModuleImpl) class. I created a few methods and expose them in the Client Interface. I read that I can only use the return types and methods of simple or serialized attributes in the Client Interface of AM. I need to create a method with the variable number and type of parameters, something like "Createwithparams", something like:
        public void Method(String[] FieldNames, Object[] FieldValues)
    Is there a way to do it?

    TKS.

    You just did it. It should work as far as I know.
    If you can not make available the method try list instead of normal array.

    Timo

  • Conversion hexadecimal number / date

    Hello!

    Im having a problem of conversion of hexadecimal code number / date.

    Select low_value, ALL_TAB_COL_STATISTICS high_value;

    IV tried HEX_TO_CHAR and that works very well.

    Select column_name, UTL_I18N. RAW_TO_CHAR (low_value), UTL_I18N. RAW_TO_CHAR (high_value), low_value, UTL_I18N. RAW_TO_CHAR (HIGH_VALUE) from ALL_TAB_COL_STATISTICS where owner = 'user' and table_name = 'table_name ';

    If you type this statement, you will see that the numeric fields and date fields get caught in () type of fields.

    Any solution for this?

    BR / S-A

    Published by: SweAnderline on 14-nov-2008 12:58

    http://www.psoug.org/reference/DBMS_STATS.html

    SELECT column_name, data_type, low_value, high_value
    FROM dba_tab_cols
    WHERE table_name = 'AIRPLANES'
    AND column_name = 'ORDER_DATE';
    
    set serveroutput on
    
    DECLARE
     rv RAW(32) := '786B060818023A';
     dt DATE;
    BEGIN
      dbms_stats.convert_raw_value(rv, dt);
      dbms_output.put_line(TO_CHAR(dt));
    END;
    

Maybe you are looking for

  • iOS iphone 10 does not connect to the DHCP wifi

    Updated IPhone 6 to 10 of IOS, and now the phone will not connect to my BT Home Hub 5.  All other devices will still be another phone that has 10 IOS. The phone recognizes the router password, puts a blue check mark against the connection, but no wif

  • Adding redundancy backup with time Capsules

    Are there problems associated with adding a second time Capsule to my system in order to add additional redundancy and safety of my backup options? I have a MacBook Pro and a single Capsule of 3 TB. I am looking for a non-Cloud option add extra secur

  • What is this security shield Virus Scanner Software?

    IT SCANNED MY LAPTOP, THIS SECURITY SHIELD software 2012 antivirus tells me to buy the product and save the activation key and open up my firewall. is this MICROSOFT.can I buy it offline?

  • firmware revision history

    PS. This problem with the messages editor happens to me with opera 9.64 OK, I'm too bored on this editor which inserts the line _avant_ paragraph breaks when I press on enter at the end of line, you'll have to read my post back. sentence leads less s

  • Cannot sync with Sony Bridge for Mac iPhoto albums

    When I connect the Sony Xperia Z3 compact Mac, Sony for Mac. bridge arises. I select the option explore iPhoto. At first nothing shows up (the developers of Sony, it would be nice to show at least a cone of propeller or progress bar), but after a whi