calculate with dates

Hello

I want to calculate with dates.

The first date is the current date. The second is a date in the future. In a third field, it should be calculated the amount of the days during these two dates. (taking into account leap years = Schaltjahr...)

For example:

First of all the field/date: today is the 23.06.2010

Second zone/date: the date in the future is the 25.06.2010

Third field: (2 /) 3 (days)

Code? : event.value = ((AFMakeNumber (this.getField("dateInTheFuture").value)-(this.getField("curren_tDate").value)))

Can someone help me?

Thank you in advance!

Date2Num and rawValue are LiveCycle objects only. You use LC or

Acrobat forms?

Tags: Acrobat

Similar Questions

  • Working with date and time of the request for help from acrobat JavaScript...

    This coming from

    Working with date and time in Acrobat JavaScript (part 1 of 3)

    The following code adds five days to the current date, and then prints the new date in the console window.

    Get the date and time

    var rightNow = new Date();

    Get the value of millisecond

    Article date

    var msRightNow = rightNow.getTime ();

    Calculate in milliseconds, of 5 days

    5 days x 24 hours/day x 60 min / h x 60 s / min x 1000 ms/s

    Challenge of var = 5 * 24 * 60 * 60 * 1000;

    Do the calculation of var CFAbsoluteTime = msRightNow + challenge;

    Create a new Date from the calculated value

    var theNewDate = new Date (finalTime);

    In the actual work on a form code, you'll want to place the

    the object of a field value. But since this is test code, we will

    Print the result to the Console window (great for debugging)

    Console.println ("5 days from now is:" + theNewDate.toString ());

    The foregoing is the exact code (cut and paste)

    The error I get here is;

    ReferenceError: theNewDate is not defined

    1:Console:exec

    undefined

    To get the "undefined" question a lot... it seems to me, learn to distinguish the undefined 'of type' undefined 'variable' and undefined 'value '.

    in this case 'theNewDate' seems to be defined as a variable equal to the current date plus 5 days... BUT I am now "educated" enough to 'see' Why am I getting the error...


    Any thoughts... Any who...

    You need to highlight all the text that you want to run.

    You have not set the rightNow variable before you can apply a method to the variable.

    You can just add a new variable as msRightNow name. Why not use rightNow.

    Executes the code that you provided with a new departure of Acrobat, I get the following error messages:

    rightNow.getTime is not a function

    1:Console:exec

    TypeError: rightNow.getTime is not a function

    1:Console:exec

    undefined

    What you are showing probably works because your previous attempts have left behind them a variable "rightNow" and as long as you do not have the object of time date change too much, you will not notice the error.

    Cleaning of your code:

    get the number of milliseconds of the date object.

    rightNow var = (new Date()) .getTime ();

    define 5 days in milliseconds;
    Challenge of var = 5 * 24 * 60 * 60 * 1000;

    Add 5 days to the value of this moment and assign the result to the last time;
    var CFAbsoluteTime = rightNow + challenge;

    convert finalTime value in a date object.
    var theNewDate = new Date (finalTime);

    display the result;
    Console.println ("5 days from now is:" + theNewDate.toString ());

    Have you tried the code that I provided, it is another way to add days to the date object.

  • calculate a date field first of the month

    I need to calculate a date field using date of hire as a base date, and it should return the first of the month following 30 days of date of hire.  (date of rental + 30 days then first of the month following that date).

    Hello margery497,

    In this scenario, you can create a text field 1 with validation as a calculated field and can add now() formula inside. Then, in the text field 2, you can add the now() + 30 formula and save it with the calculated field.

    Here is the reference for validating field:

    http://helpx.Adobe.com/EchoSign/KB/form-fields---validations.html

    Kind regards

    -Usman

  • How to calculate stock data aging

    How to calculate inventory aging of data:
    _*PRS_DTE*_     _*PRD_COD*_     _*PRD_TYP*_     _*DRB_QTY*_     _*CRD_QTY*_
    15/07/2011     2012001234           1                           100                              0
    15/08/2011     2012001234           1                           200                              0
    16/08/2011     2012001234           1                           0                              50
    15/06/2011     2012001234           1                           125                              0
    15/09/2010     2012001234           1                           150                              0
    On top of the data, balance the stock of data is produced * 525 * by subtracting CRD_QTY from DRB_QTY. Now his result of aging from 18 September 2011 "should be like this:"
    _*PRD_TYP*_     _*PRD_COD*_        _*90 Days Stock*_     _*Less than 90 and from the start of year Stock*_   _*2010 Stock*_   _*2009 Stock*_   ...and so on upto previous 5 years
             1                2012001234                   300                                            125
             100                    0               ...
    Can I get this SQL result? I do not want to write cursors and loops to get the above given the result even if it is possible.

    Hello

    kamranpathan wrote:
    Dear Frank, thank you again for an impeccable answer. Sorry for a delay feedback coz I was sick of a fever. I tested the provided query u n that has worked well. but I did not understand then u points marked the end of the answer of the urs:

    Prs_date is a DATE: don't try to INSERT a VARCHAR2 value into a DATE column.
    

    If 20/SEP/2011 ' is not the correct format, so what fix the Date Format?

    In Oracle SQL, anything inside single quotes is a VARCHAR2. (There is an exception; I'll be back later.)
    "a,"
    '2' and
    "the square root of 9'.
    are all inside single quotes, so they are VARCHAR2s, not numbers. A human being who sees these chains might think of figures, but they are still VARCHAR2 strings and not numbers.
    20/SEP/2011 '.
    'September 21, 2011', and
    'Yesterday '.
    are all inside single quotes, so they are VARCHAR2s, not DATEs. A human being who sees these chains might think of DATEs, but they are still VARCHAR2 channels and not dates.
    When you use the wrong data type (for example, when you use a VARCHAR2 in a place where we expect a DATE) Oracle will try niot very hard to trigger an error. It will try to convert a DATE VARCHAR2. Sometimes it can work, other times it cannot. It is never a good idea to expect that such implicit Conversion will work; You must always use the correct data type instead. For example, the prs_dte of the aging_test table column is a DATE. When you say:

    INSERT INTO aging_test (prs_dte) VALUES (x);
    

    Oracle expects x as a DATE, so do not put some other datatype as a VARCHAR2 in place of x.
    The TO_DATE function returns a DATE, so a correct is to INSERT a line in aging_test:

    INSERT INTO aging_test (prs_dte) VALUES (TO_DATE ('20/SEP/2011', 'DD/MON/YYYY'));
    

    This is an example of a +Explict Conversion +. The TO_DATE function expects two arguments to be VARCHAR2s, and that's exactly what they are in the example above: the two arguments are of the literal string, enclosed in single quotes.

    There is an exception, as I mentioned. When the DATE keyword (or TIMESTAMP) comes immediately before the first single quote, then single quotes, everything that comes between them and the keyword itself form a DATE literal (or a literal STAMP, but I'll just talk about DATEs in the future). The stuff between single quotes must be in YYYY-MM-DD format, otherwise you will get an error. So another acceptable way to enter a row in the aging_test table is:

    INSERT INTO aging_test (prs_dte) VALUES (DATE '2011-09-20');
    

    It is only as good as in the example above (those used TO_DATE), and has the same results. You can use any you like.

    the age_prd can never be ' 'Less than 90 and from 01/01/2011'. 
    

    Yes my dear, in my case that I really need this period of aging, I don't know why, but sometimes, being a service Department (IT), we fullfuil insensitive logic of user.

    Remember how BUSINESS works.
    When you say

    CASE
        WHEN  c1  THEN  r1
        WHEN  c2  THEN  r2
    END
    

    the c1 State is evaluated first. If c1 is set to TRUE, then the CASE expression returns r1, and the rest of the CASE expression is not evaluated.
    What happened in this CASE of expression, where x is a NUMBER?

    CASE
        WHEN  x > 0  THEN  'Positiv'
        WHEN  x = 2  THEN  'Zwei'
    END
    

    This CASE expression will never return 'Zwei', because the condition "x = 2" is just a special case of the prior"x > 0". If this CASE expression is executed when x = 2, then the 'x > 0' condition is evaluated, it turns out be TRUE, and "Positiv" is returned. The following condition is not even considered.
    In the expression you have posted:

    `        Case
                 When Age.Prs_Dte Between (Sysdate - 90) And Sysdate Then
                           '90 Days'
                 When Age.Prs_Dte Between (Sysdate - 61) And Trunc(Sysdate, 'RRRR') Then
                           'Less than 90 and from 01/01/2011'
    ...
    

    the value 'less than 90 and since 01/01/2011' will never be returned. the condition "Age.Prs_Dte between (Sysdate - 61) and Trunc (Sysdate, 'RRRR') ' is a more narrow condition that" Age.Prs_Dte between (Sysdate - 90) and Sysdate. Any SYSDATE value which translates by "Age.Prs_Dte between (Sysdate - 61) and Trunc (Sysdate, 'RRRR')" TRUE will as a result in the previous state, "Age.Prs_Dte between (Sysdate - 90) and Sysdate" being TRUE.

    If you need an expression BOX which will return sometimes 'less than 90 and since 01/01/2011', then do not use the one you posted. I don't know what you should use, because I do not understand your business needs. Post some sample data (CREATE TABLE and INSERT statements for a table with the columns prs_dte and sys_date), display the results you want sample data and explain how you get these results from these data, and someone will help you write a CASE expression that produces these results.

    Only use "date3 BETWEEN date1 AND date2" when date1 and date3 are always midnight. 
    

    I really did not understand what point completely.

    Sorry, I wasn't very clear. What I meant is that a lot of people make mistakes in using BETWEEN with DATEs, because they forget that all DATEs include hours, minutes, and seconds. If the hours, the mionutes and seconds all arrive at 0, then BETWEEN works the way they expect. When the hours, the minutes and seconds are not all 0, then these people are often confused.
    For example, in my time zone is currently about 17:58 September 23, 2011, so at present, nor this condition:

    SYSDATE  BETWEEN  TO_DATE ( 'JAN/01/2011', 'MON/DD/YYYY')
             AND      TO_DATE ( 'SEP/23/2011', 'MON/DD/YYYY')
    

    or this condition

    SYSDATE  BETWEEN  TO_DATE ( 'SEP/24/2011', 'MON/DD/YYYY')
             AND      TO_DATE ( 'DEC/31/2011', 'MON/DD/YYYY')
    

    is set to TRUE. Which can be confusing.
    If change us one to tell us "SEP/24"instead of "SEPT. 23." /', then it would be a point in time (that is midnight on 24 September) when the above two conditions were TRUE. Which can be confusing.
    Similarly, if we leave "SEP/23 ' in the first condition and change the second condition to say" SEP/23 ' rather than ' SEP/24 ', then there is also a point in time when both conditions are TRUE.»»» Which can be confusing.
    I admit it is subtle and can be difficult to understand if you don't really understand how work DATEs.
    If all goes well, it is easy to understand: don't use not BETWEEN with DATEs. The results are not what you expect if you don't really understand how work DATEs.

  • Use thunderbird on several computers with data on server

    I want to use Thunderbird on my network home/office computers with data on a central computer. For the moment, I need to use mozbackup to transfer data from my desktop computer to laptop, which is a pain.

    Graeme

    As already mentioned, IMAP is the best method, but you can move the profile on the central computer folder and then have TB on each computer pointed to this location using the Profile Manager.

    http://KB.mozillazine.org/Moving_your_profile_folder_-_Thunderbird#Use_the_Profile_Manager_to_move_your_profile

    Another method is to copy a profile on a network share and start TB with command line arguments that specify the profile.

    3rd point: http://kb.mozillazine.org/Synchronizing_mail_on_two_computers

    There is a method of moving just the records of e-mail to another location:

    http://KB.mozillazine.org/Moving_your_mail_storage_location_%28Thunderbird%29

  • I recently updated my iPhone to iOS 9.3 6s and now my data and wifi are in place. Now I can't open the apps and send messages with data and barely on the wifi. I've tried everything, and it still does not work.

    I updated my iPhone to iOS 9.3 6s today and now my data and wifi are in place. Whenever I try to open an app or send text messages with data it does not at all. And with wifi, it just works. I tried just like turn roaming off and off and other lte but nothing seems to work at all. Can someone please?

    I have this same problem too, it really gets me upset

  • do you need a power supply to the current entry with data acquisition or 9265

    Hello I just receive the NI 9265 Daq for research in my lab. I'm trying to present entry and display it on an oscilloscope. I don't get anything. I did some research on the internet, so my question is do you need a power supply to the current entry with data acquisition or 9265?

    Read the data sheet.  Clearly on the first page is a sentence which reads "the NI 9265 requires 9 V to 36 V external power.

  • Make XY graph from the string with date and time data

    1 all sorry for my English.

    I have files with data. In this array of strings, I have 2 columns with date and time. I want to show these data to the XY Chart with time and date on some of the DBL and X on Y.

    I tried to do it by myself, but cannot add to time on X axis.

    Hi olderon,

    you date string is something like "30.01.2014" but looking for "%d//%m %y. Spot the problem?

  • I have a sony ericsson phone with data cable but cannot import pictures on pc

    I have a sony ericsson phone with data cable but cannot import pictures on pc

    I have a sony ericsson phone with data cable but cannot import pictures on pc

    =====================================
    When you connect via a USB cable... go to... Start / computer...
    the phone should be listed as a drive letter. You should be
    able to access photos from there.

    Also... If the AutoPlay window isn't launchng when the phone
    is connected... perhaps the following will provide some ideas:

    Windows Vista-
    How to change the auto run settings
    http://Windows.Microsoft.com/en-us/Windows-Vista/Change-AutoPlay-settings

    Windows Vista-
    Troubleshoot AutoPlay
    http://Windows.Microsoft.com/en-us/Windows-Vista/Troubleshoot-AutoPlay-problems

    Windows Vista-
    AutoPlay: Frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/AutoPlay-frequently-asked-questions

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • The default value for a property with data of type boolean

    Hi all

    Is it a system preference setting, where the default value for a property with data of type boolean can be a Virgin? I want to keep the value by default in a vacuum, but every time I save the property even after empty selection, the default value changes to FALSE.

    Capture.JPG

    In this case Boolean doesn't help you, you mayneed to create a chain of ownership and have true/false / "" as your list of values

  • Confusion with data sources / recordsets... ??

    I used to use Dreamweaver very strongly.  It has been a while, however, and now I'm loading up an old project that has been entirely developed "the way Dreamweaver" with games records and the use of extensions such as WebAssist gap.

    I opened Dreamweaver CC 2015.3 and I'm not finding anything on the Server Anywhere behaviors as I expected.  When I opened my pages that have the recordset data on them, or the shopping cart data, etc. I don't see all the windows of any place showing me that the data the way I used to see.

    I did a quick search in the help documentation and he said I should see a Panel under window-> links links, but I have no connections.  Don't know why... ??

    I did some digging and found a thread where it said that I had to install an extension, and it points me to a path for Windows Vista / Windows 7: C:\Program Files (x 86) \Adobe\Adobe Dreamweaver CC\Configuration\DisabledFeatures

    I'm on Windows 10, however, and I do not have a DisabledFeatures folder to the suggested location.

    I'm also confused why this would be an extension at this point... ??  Recordsets has been one of the most powerful features of Dreamweaver (I thought).  How am I supposed to my configuration database connections and to create and manage the data of the database now?

    More importantly, how do I get my old project works in the same way that he used?

    Any information on this would be greatly appreciated.  Thank you!

    Adobe dropped their Director Extension of development in 2015.

    Here are 3 freebies that you can use to install 3rd party extensions.  I used all the success.

    Anastasiy extensions Manager

    http://install.anastasiy.com/

    The seven extensions of the project manager

    http://www.Projectseven.com/extensions/

    The DMX Zone extensions Manager

    http://www.DMXzone.com/go/22670/DMXzone-extension-manager-for-Dreamweaver

    Replace deprecated server behaviors with a modern commercial extension:

    To work with data Dynamics and PHP, you need a local test server.

    See setting up a PHP environment in Dreamweaver

    http://www.Adobe.com/devnet/Dreamweaver/articles/setup_php.html

    Nancy O.

  • How to generate the display of mobile list with data of the user

    I try to develop a simple mobile application (mobile jquery) in Dreamweaver.

    I want to create a list of names of people from entering information via a form.

    The list would then be based on criteria that is last name or Department

    This require additional database programming or it is part of jquery mobile?

    I know it sounds simple, but I'm not a programmer, so I'm just my feet wet here.

    Thank you

    DW has no capability of database currently.  If you do programming server side with PHP and MySQL, there are commercial extensions, you can buy separately from the Web help and area of DMX.  But it's all depends on you how to work with data MySQL & PHP.  Development of applications for mobile devices is still a different learning curve.  I think DMX Zone has some extensions to help with that as well.

    http://www.DMXzone.com/go/32214/mobile-app-development/

    Nancy O.

  • Help with date required

    Hello

    I have two columns with the date and the other with time, but both are vchart2.

    What is the best way to convert a column of actual date

    or add a column with the effective date and fill it with data from the first and second column

    in the format (12 October 2013 10:31:11 ', JJ 24HH:MI:SS)?

    Thank you very much

    Hello

    user9223521 wrote:

    ...  You're right, that a space between column1 and column2 is useful.

    I do not think that a space it is useful, but if you think it is, go ahead and add - we.  The important thing is that the data in the 1st argument to TO_DATE having match format in the 2nd argument.  If there is no space between the year and the time in the 1st argument, then do not use a space between the year and hour in the 2nd argument.

    This code is not convert the column or add a column? ...

    It's true.  Replace the 2 columns existing VARCHAR2 with a DATE column is a good idea.  Here's a way to do it:

    1. Use ALTER TABLE to add a new column (let's call it entry_dt.  You cannot use the same name as one of the existing columns.)
    2. UPDATE the table using TO_DATE as shown above, to set the value of entry_dt
    3. Use ALTER TABLE to drop the old column1 and column2
    4. If you want to rename entry_dt to one of the old names of columns, use ALTER TABLE to this

    If you have incorrect or invalid data, then step 2 fails.  See

    Re: How to select valid dates only

    of the means to detect bad data without triggering an error, then you can fix before the UPDATE, or ignore it all by doing the UPDATE.

  • I need to merge a form with data in Excel, how can I do?

    Hello, I use a form to fill out on-line the Government and need to fill it with data in Excel. How can I do?

    Thank you very much.

    MY

    This type of operation is called a mail merge. It can be done using the PDFMaker plugin in (some versions of) Office, or by using a script.

    The names of the columns in the Excel file must match the names of the fields in the PDF file, however.

  • Round and Trunc with dates

    Can I get the examples for round and Trunc with dates?

    Like this? ;)

    with
    test_date as
    (select to_date(:a_date,'yyyymmddhh24miss') the_date
              from dual
    )
    select the_date,'CC' pattern,round(the_date,'CC') rounded,trunc(the_date,'CC') truncated from test date
    union all
    select the_date,'SCC' pattern,round(the_date,'SCC') rounded,trunc(the_date,'SCC') truncated from test date
    union all
    select the_date,'SYYYY' pattern,round(the_date,'SYYYY') rounded,trunc(the_date,'SYYYY') truncated from test date
    union all
    select the_date,'YYYY' pattern,round(the_date,'YYYY') rounded,trunc(the_date,'YYYY') truncated from test date
    union all
    select the_date,'YEAR' pattern,round(the_date,'YEAR') rounded,trunc(the_date,'YEAR') truncated from test date
    union all
    select the_date,'SYEAR' pattern,round(the_date,'SYEAR') rounded,trunc(the_date,'SYEAR') truncated from test date
    union all
    select the_date,'YYY' pattern,round(the_date,'YYY') rounded,trunc(the_date,'YYY') truncated from test date
    union all
    select the_date,'YY' pattern,round(the_date,'YY') rounded,trunc(the_date,'YY') truncated from test date
    union all
    select the_date,'Y' pattern,round(the_date,'Y') rounded,trunc(the_date,'Y') truncated from test date
    union all
    select the_date,'IYYY' pattern,round(the_date,'IYYY') rounded,trunc(the_date,'IYYY') truncated from test date
    union all
    select the_date,'IYY' pattern,round(the_date,'IYY') rounded,trunc(the_date,'IYY') truncated from test date
    union all
    select the_date,'IY' pattern,round(the_date,'IY') rounded,trunc(the_date,'IY') truncated from test date
    union all
    select the_date,'I' pattern,round(the_date,'I') rounded,trunc(the_date,'I') truncated from test date
    union all
    select the_date,'Q' pattern,round(the_date,'Q') rounded,trunc(the_date,'Q') truncated from test date
    union all
    select the_date,'MONTH' pattern,round(the_date,'MONTH') rounded,trunc(the_date,'MONTH') truncated from test date
    union all
    select the_date,'MON' pattern,round(the_date,'MON') rounded,trunc(the_date,'MON') truncated from test date
    union all
    select the_date,'MM' pattern,round(the_date,'MM') rounded,trunc(the_date,'MM') truncated from test date
    union all
    select the_date,'RM' pattern,round(the_date,'RM') rounded,trunc(the_date,'RM') truncated from test date
    union all
    select the_date,'WW' pattern,round(the_date,'WW') rounded,trunc(the_date,'WW') truncated from test date
    union all
    select the_date,'IW' pattern,round(the_date,'IW') rounded,trunc(the_date,'IW') truncated from test date
    union all
    select the_date,'W' pattern,round(the_date,'W') rounded,trunc(the_date,'W') truncated from test date
    union all
    select the_date,'DDD' pattern,round(the_date,'DDD') rounded,trunc(the_date,'DDD') truncated from test date
    union all
    select the_date,'DD' pattern,round(the_date,'DD') rounded,trunc(the_date,'DD') truncated from test date
    union all
    select the_date,'J' pattern,round(the_date,'J') rounded,trunc(the_date,'J') truncated from test date
    union all
    select the_date,'DAY' pattern,round(the_date,'DAY') rounded,trunc(the_date,'DAY') truncated from test date
    union all
    select the_date,'DY' pattern,round(the_date,'DY') rounded,trunc(the_date,'DY') truncated from test date
    union all
    select the_date,'D' pattern,round(the_date,'D') rounded,trunc(the_date,'D') truncated from test date
    union all
    select the_date,'HH' pattern,round(the_date,'HH') rounded,trunc(the_date,'HH') truncated from test date
    union all
    select the_date,'HH12' pattern,round(the_date,'HH12') rounded,trunc(the_date,'HH12') truncated from test date
    union all
    select the_date,'HH24' pattern,round(the_date,'HH24') rounded,trunc(the_date,'HH24') truncated from test date
    union all
    select the_date,'MI' pattern,round(the_date,'MI') rounded,trunc(the_date,'MI') truncated from test date
    

    Concerning

    Etbin

Maybe you are looking for