Adding a year to the current date field

Hello,
Can any one please help on how to add a year to the current date field.
e.g 7/19/2011 plus a year = 7/19/2012
Thanks,
Han Dao

If you had a field DateTimeField1 and wanted to display the following year in DateTimeField2, you could do the following in JavaScript;
var d1 = util.scand("yyyy-mm-dd", DateTimeField1.rawValue);
if (d1 !== null)
d1.setFullYear(d1.getFullYear()+1);
DateTimeField2.rawValue = util.printd("yyyy-mm-dd", d1);
Good luck
Bruce

Similar Messages

  • Web-Outlook appointments which are one year before the current date are removed

    Hi,
    my Web-Outlook works fine with my iPHONE4s but the appointments which are one year befoer the current date are removed.
    Is there an option to keep all appointments?
    regards
    Andreas

    For the OST problem, delete the OST file and let Outlook create a new one.  But your problem may be that Outlook connects to Exchange 2013 using Outlook Anywhere only--MAPI RPC is gone--and for that you need a valid certificate.  So the self-signed
    certificate is likely your main problem.
    For a self-signed certificate to work, you must add it to every client as a trusted certificate.  That is hard to do with mobile devices, which is why it's recommended to obtain a certificate from a trusted public certificate authority.  You'd
    probably find Go Daddy to be reasonably priced, and there are others.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Can a user override the Current Date field?

    I have a simple form with a Current Date field.  Today's date is automatically populated in this field, but I would like to give users the option to enter a different date in the field.  There is a value called "Calculated - User Can Override" but this doesn't appear to work.

    When I first set up this field I used code I found on this forum that went in the 'layout:ready' area.  I've now removed it and used the code I found in your file in 'calculate'. The date field is now functioning properly.
    Thank you.

  • Parameter for Last Week, Last Month & Last Year from the current Date

    I have a crystal report that has a StartDate & EndDate parameters from the stored procedure that I am calling. Now i got a new requirement saying that my user wants a drop-down parameter in which they need to be able to select last week (Sunday to Saturday), last month, last year instead of manually selecting start date and end date parameters? Can anyone please explain me how to do this?
    (FYI, I am using Crystal 2008)

    Hi Naveen,
    You'll need to handle the logic in the Stored Proc's where clause.
    If you're using oracle, I have something like this in the Stored Proc's where clause for our reports:
    Where {Date_Field} Between
    Decode('{?Relative Date}',
    'Yesterday', sysdate - 1,
    'Last Week', Tunc(sysdate, 'IW')-7)
    AND
    Decode('{?Relative Date}',
    'Yesterday', sysdate,
    'Last Week', Tunc(sysdate, 'IW'))
    where 'Relative Date' is a prompt in the Stored Proc and 'yesterday'. 'last week' are the 'static values' in the prompt.
    -Abhilash

  • Current Date Field question

    Hello
    I'm a novice user of LiveCycle and I'm trying to see if there's a solution for this issue we've come across.
    We've used LiveCycle to redesign human resource/payroll forms in our organization. One of the items we use is the current date field, which automatically populates to today's date once opened. When users complete forms, we encourage them to save an electronic copy of the form to their own drive in case they need to retrieve it at a later date. The problem here is that the current date field will not stay static once filled out and saved.
    For example, if a dept completes a form on 12/1/10, saves it, but then needs to retrieve it later for some reason, we need the current date field to stay as the date the form was originally filled out (12/1/10). If they retrieve the form later on say 2/15/10, that particular date field will read the new date. Is this possible?
    Thanks for any help!

    Test if the field is null before assigning the current date.
    // form1.page1.currentDate::ready:layout - (FormCalc, client)
    if (this.isNull) then
      $.rawValue = Concat(Num2Date(Date(), "MM/DD/YYYY"))
    endif
    Steve

  • Embedding a "Current Date" field in a pdf document

    To assure people work to the latest authorized version of a procedure, we let them access a protected pdf version on our Intranet. They can print a copy for use, but the copy is valid ONLY for the date printed, which is shown in the footer of each page. The "current date" field is updated when the document is opened by way of a Java script that reads:
    var f = this.getField("Today");
    f.value = util.printd("mm/dd/yyyy", new Date());
    (Obviously, "Today" is the field's name.)
    If a person were to open the same document three days later, that later date would be embedded.
    All this worked well when we were using Acrobat 5 and Reader 5. Now, to keep up with the times, we've upgraded to Acrobat 8 and Reader 8 on many PCs. However, the "current date" field still works for those still using Reader 5 but doesn't work for those using Reader 8.
    What I'm wondering is whether the scripting has changed for Acrobat 8. I can't find anything in the Acrobat support documents for Java scripting, but I may not know what I'm looking at.
    Thanks,
    Jerry Holt
    [email protected]

    The problem has been solved!!!
    The form field, the accompanying script, and most documents' security were set up in Adobe 4.0. However, in Adobe Reader 7 or higher, "no changes" means "no changes," so the form field script was blocked.
    By setting Compatibility to "Acrobat 7.0 or greater," I could choose the "Change Allowed" option: Filling in form fields and signing existing signature fields.
    Then, all I needed to do was to confirm that the JavaScript "Today" was still applied, and the current date was immediately filled in.
    Thanks for the questions and suggestions.

  • Changeable Current Date field

    I need the "Current Date" field enabled to be changed by the user. Any help will be appreciated.
    I thought the "Calculated - User can Override" would work but no such luck! (I am using the Custom - Current Date field)
    Thanks

    Hi,
    The custom current date has the script in the layout:ready event. This fires everytime the user exits an object that has been changed.
    So what is happening is that the user can access the date field and change the value, however when they exit the field, the layout:ready event fires and the user-entered data is overwritten by the current date.
    You could move the script from the layout:ready event to the docReady event. This is a good event because it only fires once, when the form is opened/rendered.
    You will probably need to wrap the script in an if statement, so that when the form is reopened, it does not overwrite the date. The following FormCalc should work:
    // Current Date in short-style date format.
    if (HasValue($) eq "false") then
         $.rawValue = num2date(date(), "DD.MM.YYYY")
    endif
    There is an example here: https://acrobat.com/#d=QR1y1RYatwSaQAWa4-jLlA
    You can see events and how they fire here: http://assure.ly/gW3RNr
    Hope that helps,
    Niall

  • Restricting date selection of the calender date field

    Right now we have a web app where you choose the starting date of a work week. We're using the calender date field to get that date. However, our client wants to restrict that to just the Mondays of the month. Is it possible to do this?

    Hi Nagy,
    The way I would approach this is by implementing that kind of calendar picker myself, from some jQuery plugin or maybe a couple of simple dropdowns, and then use javascript to populate the current date field which would be hidden. You just have to make sure that the date format looks like this:
    03-Oct-2012
    Cheers,
    -mario

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • How do I add a current date to a form field so that it will give me the current date each time it is opened?

    I have adobe 9 pro. I am currently adding fields to a document and would like my date field to display the current date when the document is opened so that the user does not have to enter the date each time. How do I do that?

    Have you searched for this issue. It has been answered many times.
    Example Acrobat JavaScripts
    Scroll down to the . Insert Today's Date into Form Field section.

  • How can I set the date field to auto populate the current date?

    I have many forms to create where the current date dictates a specific change in options or conditions for the form filler to follow. I cannot see any way to handle that issue. Is it possible to simply set the current date as a default?
    jcytrny

    Sorry, we currently do not support having today's date show up in a date field by default
    Randy

  • FM to calculate date month & year six months previous to the current date

    Hi All,
    Is there any function module or code to calculate date month & year six months previous to the current date.
    Thanks in advance.

    hi,
    try this
      data : date1 like vbak-erdat.
    data : q type numc3.
    selection-screen : begin of block blk2 with frame title text-001.
    parameters : n like q.
    selection-screen : end of block blk2.
    if n > 0.
    CALL FUNCTION 'CCM_GO_BACK_MONTHS'
             EXPORTING
               CURRDATE         = sy-datum
               BACKMONTHS       = n
           IMPORTING
              NEWDATE          = date1
    selection-screen: begin of block blk1 with frame title text-001.
    select-options :  s_date for vbak-erdat default 'NEWDATE'  to 'sy-datum' no-display.
    selection-screen : end of block blk1.
    write : date1.
    Reward with points if helpful.

  • How do I insert the current date to hidden field?

    I have a form for updating personal information.  There is a field in the table called "dateupdated" that I would like to have on the form as a hiddent field that will automatically get the latest date (now).
    Any idea's how I can set the hiddden field to current date?
    Thanks,  Dennis

    You don't need a hidden field to do that. Depending on the database you're using, you can either use a TIMESTAMP column (in MySQL) that is automatically updated, or you can use a SQL function to insert the current date.
    For example, in PHP, you can use NOW() like this in a SQL query:
    $insertSQL = sprintf("INSERT INTO date_test (created, message) VALUES (NOW(), %s)",
                           GetSQLValueString($_POST['message'], "text"));

  • How to prevent an automatic fill in of the current date into a Date/Time Field

    hi,
    maybe i checked out a strange behaviour of the adobe designer. when i put a "normal" data/time field (with no data pattern, display pattern, etc.) on a form and then change (on the pdf preview tab) to the newly designed date field,i have to stay about 2 minutes on this field not filling it out.
    after these minutes the current date is filled in automatically in the date/time field.
    what can i do preventing that? any hints?
    thanks in advance.
    markus

    I don't have any info on timelines, all I can say is check back in future versions of Acrobat :(
    Chris
    Adobe Enterprise Developer Support

  • Can a field be made to pull the current date from computer or internet and display it?

    Im making a form for someone and they want the current date of when the form is opened to be displayed at the top without having to type it in.  Is this possible?  I assume this has something to do with javascript but I dont know anything about that stuff

    Hi,
    I search something in the forum and found your message. If you need it once again, try this:
    var f = this.getField("currentDate");
    f.value = util.printd("dd.mm.yyyy",new Date());
    Or this one (helpful for Germans who want to display their date like this: 29. Juni 2010. If you take the first one in the dd. mmmm yyyy format, it shows you the month in English. 29. June 2010):
    var f = this.getField("currentDate");
    f.value = util.printd("date(de){DD. MMMM YYYY}", new Date(), true);

Maybe you are looking for