Current date & time in text field

I need to auto-fill a text field with four letters plus the current date and current time. The text field should populate when the user clicks a checkbox.
For example, if today is April 25, 2012 and the current time is 10:27 a.m., the text field should read: UNIS0425121027.  (The time can be in military time or not - it doesn't matter.)
Thank you in advance for any help you can offer.

Try the following in the initialize event of the text field.
Change the script language to FormCalc.
TextField1.rawValue = Concat("UNIS",Num2Date(Date(),"MMDDYY"),Num2Time(Time(),"HHMM"));
Thanks
Srini

Similar Messages

  • Adobe LiveCycle Designer 8 - Add days to Current Date in another text field

    Hi-
    I am working on an expense report. I have six fields, CurrentDate, and countDate1 through countDate5. The CurrentDate is a Time/Date field which the user can select whatever date is needed with the drop down calendar. The other five countDate fields are "text" fields which will represent Monday through Friday. I would like to add zero days to whatever the user selects as the CurrentDate and make that appear in countDate1 which represents Monday(the CurrentDate the user selects will always be a Monday), add one day to whatever the user selects as the CurrentDate and make that appear in countDate2 which represents Tuesday...and so on. I realize this is probably basic for someone familiar with FormCalc but I'm very new at this.
    This got me very close but I want the user to select the date and not have the CurrentDate already filled in.
    CurrentDate - DateTime field, FormCalc calculation script:
    num2date(Date())
    Date1 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue))
    Date2 - Text field, FormCalc calculation script:
    Num2Date( Date2Num(CurrentDate.formattedValue) + 1 )
    Thanks!
    Brian

    Here is an exmaple of adding days the script is used in the "exit" event for the date select field that has display format of "MM/DD/YYYY". Adding days requires add x number of days to the days since the epoch date for the current date, adding months or years one needs to manipulate the string parts of the date.
    ----- form1.#subform[0].InputDateField::exit: - (FormCalc, client) ---------------------------------
    // fomatted string for selected date
    var sFmtDateValue = $.formattedValue
    var sMsg = Concat("Entered date formatted: ", sFmtDateValue) // build message string
    sMsg = Concat(sMsg, "\u000a" ) // add new line to message
    // convert date string to days since epoch date - format is important
    var fDaysPast = Date2Num(sFmtDateValue, "MM/DD/YYYY")
    // add 7 days to days past epoch date
    var f7DaysPlus = fDaysPast + 7 // add 7 days
    var s7DaysPlus = Num2Date(f7DaysPlus, "MMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 7 Days: ", s7DaysPlus) // build message string
    // add 14 days to days past epoch date
    var f14DaysPlus = fDaysPast + 14 // add 7 days
    var s14DaysPlus = Num2Date(f14DaysPlus, "MMMM DD, YYYY") // format string for 7 days plus
    sMsg = Concat(sMsg, "\u000a", "Plus 14 Days: ", s14DaysPlus) // build message string
    // display results
    // work on months
    // get parts of date past epoch date
    var sFullYear = Num2Date(fDaysPast, "YYYY") // get 4 digit year form days past epoch date
    var sMonth = Num2Date(fDaysPast, "MM") // get month form days past epoch date as number
    var sDate = Num2Date(fDaysPast, "DD") // get date form days past epoch date as a number
    var s2Month = Sum(sMonth, 2) // add 2 months
    var s2FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s2Month > "12") then
    s2FullYear = Sum(s2FullYear, + 1) // increment year
    s2Month = Sum(s2Month, - 12) // adjsut months
    endif
    var s2MonthsAdded = Concat(s2Month, "/", sDate, "/", s2FullYear) // date string
    sMsg = Concat(sMsg, "\u000a", "Added 2 months: ", s2MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    var s5Month = Sum(sMonth, 5) // add 5 months
    var s5FullYear = sFullYear
    // if more than 12 months in new date adjust year on number of months
    if (s5Month > "12") then
    s5FullYear = Sum(s5FullYear, + 1) // increment year
    s5Month = Sum(s5Month, - 12) // adjsut months
    endif
    var s5MonthsAdded = Concat(s5Month, "/", sDate, "/", s5FullYear) //build Date string
    sMsg = Concat(sMsg, "\u000a", "Added 5 months: ", s5MonthsAdded) // display stringxfa.host.messageBox(sMsg, "Sample Adding Days" ,3, 0);
    // display results
    xfa.host.messageBox(sMsg, "Sample Adding Days and Months" ,3, 0);

  • Current Date in the Text Field

    Hi,
    I have got a requirement where i have one text field and one data/time field. Once we select the date from the date field, the date selected in the date field should be reflected in text field in the format DD.MM.YY along with some other text.
    for example,
    if we select date as 03/02/2009 - Date Field, we should get it as
    Today is (date with format DD.MM.YY)

    On the exit of the Date field write the javascript code:
    TextField.rawValue = "Today is " + this.rawValue

  • Insert current date/time and username into form.

    Apologies for newbie question.
    I have a form based on table Customer, within the table I have username and modifiedDate columns. How can I populate these text fields with the current user and current date/time ?
    Thanks.

    Excellent, thanks for the fast response. I had this working and then tried in on a new form and now it fails to populate the desired fields.
    I have created a process named "Insert date and username", Type P/SQL anonymous block. On Load - After Header, Once Per Page Visit.
    select :APP_USER, to_char(SYSDATE,'DD-MON-YYYY HH24:MI:SS')
    INTO :P16_USERNAME, :P16_MODIFIEDDATE
    from dual;
    Sorry for the hand holding!
    Jason
    Edited by: Jason S (UK) on Apr 24, 2013 6:57 AM

  • How can I make the current date/time be sent when emailing as XML?

    I'm creating a form for a customer to use for submitting print jobs. This customer will be emailing the XML form data, which will in turn be converted into a production order. I'd like to make the PDF form capture my customer's system time, so that I know when they filled out the form. I COULD just leave that up up the customer and use required current date and time fields, but that provides the ability for the customer to falsify that information.
    Is there any good way to capture the current date/time in the XML data, so that the customer doesn't need to nor has the ability to?
    Any suggestions would be great!

    You can use the following methods getHours(),getMinutes(), and getSeconds() from the date object to obtain the values for hour,minute,and second.
    Click here to see an example:
    http://66.34.186.88/LiveCycleSamples/.3bbc2f4b.pdf

  • HOW TO DISPLAY CURRENT DATE TIME IN MASTHEAD IN BRANDING IMAGE AREA

    Hi experts,
    I need to display current date time in masthead also and also i should change the welcome area to my own text there how it is possible.....
    and plz tell detail coding also as i dont have idea to change the coding plz help in this............
    where to chan ge and how to change.............
    waiting for u r responses......................
    Regards,
    Shilpa.

    Shilpa,
    go to system administratioon-system configuration-support-support desk-browse deployment-check for com.sap.porta.navigation.masthead.par and download it to nwds.
    when you import it to NWDS jar file will be missing so you need to manually add that to PORTAL-INF/private/lib.
    once you do this go to HeaderiView.jsp in PORTAL-INF/jsp folder.
    write
    <%= new java.util.Date()%> after <hbj:form id="HeaderForm">.for that matter u can write this at any line after this statement
    once you do that select qucik par upload from the tool bar and deploy it.
    go to system administration-system configuration-support-support desk-administration console and upload the par file
    before following these steps take a backup of par file
    reward points if helpful

  • Add current Date/Time to a database note?

    If we set the database note when we are loading the cube, what would be the syntax to set the current date/time?<BR><BR>For example...<BR><BR>ALTER DATABASE <NAME> SET NOTE <COMMENT><BR><BR>What would go in <COMMENT> in order to set current date/time?<BR><BR>Cheers!

    Hi Philip,
    There is an SAP formula variable to supply the current date in a formula. I think it is 0F_ADAY...install it from business content if you cannot see it in the query designer (formula box, under formula variables) and try using it.
    Hope this helps...

  • How to get Client(browser) current date/time in BIP report

    Hi,
    I need to display report generated date in BIP report and this should be client(browser) current date/time. I tried the following things.
    1. have used MS Word Native Date/time using Insert->Date/Time. And we have chosen the M/d/yyyy h:mm:ss am/pm format. but it is printing BIp server date/time, not client date/time.
    2. <?xdofx:sysdate?>, <?xdoxslt:sysdate_as_xsdformat()?> and <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME'?> are giving GMT Date/Time, but we need client Date/Time.
    3.<?xdoxslt:sysdate('DD-MON-YYYY HH12:mi:ss')?> is giving the system date/time of the machine where BIP server is installed.
    Could you provide some help in this??
    Thanks
    Hari

    Hello, Hari,
    what would return something like this:
    Execution date:
    <?xdoxslt:current_date('ja-JP', 'Asia/Tokyo')?>
    <?xdoxslt:current_time('ja-JP', 'Asia/Tokyo')?>
    @Vetsrini,
    for my opinion,
    in the countries where time is switching (winter/summer) using the hard coded time zones in the format-date() cause a problem:
    for example:
    if we enter the date in date prompt in summer it will return PM_DT = 2010-07-20T00:00:00.000+04:00
    in winter 2010-07-20T00:00:00.000+03:00, so,
    using <?format-date:PM_DT;'DD.MM.YYYY';'GMT+3'?> return 2010-07-20 in winter and 2010-07-19 in summer.
    regards,
    Eldar A.

  • Date format in current date (portal smart text)

    Where can I edit colour, format of current date (portal smart text)?

    Hi,
    This might be a caching issue .. What version of portal are you using..
    Can you also change the caching properties for the page so that its never cached..
    Thanks,
    Anu

  • How to put current date time in a JTextField?

    Hi all,
    I have a problem. How can I put current date time in a JTextField? Pls help me!
    Thank you!

    Hi all,
    I have a problem. How can I put current date time in
    a JTextField? Pls help me!
    Thank you!http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTextField.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html

  • Can't get access in Time Machine to certain folders for any date earlier than current date/time.

    Can't get access in Time Machine to certain folders for any date earlier than current date/time, even when entering as Admin. Why do certain folders have small red "-" badge in lower right corner of folder icon?  Here's a picture of the dilemma:
    I've tried monkeying with priveleges using Command I, and changing users, but to no avail.  Can anyone help?

    Right.  Here's what the permissions look like from the Finder Command I:
    I'm not sure what "Custom" means, but when I then try to change it to "Read & Write", it doesn't take.... just comes back as Custom. Interesting to note that not only am I logged into Joan's account where the data folder and file lives) to do this, but when I do it from my own account  as Admin (dunc...mpster) I get the same result.

  • How to get sqlplus to print the current date/time

    From a unix command line I can type:
    prompt> date; <any_Cmd>; date
    This will result in a timestamp being output before and after the command you inserted. Is there a way to make sqlplus print the current date/time after it is done executing an sql statment. This would be useful for me to know how long it took to execute and sql statement without watching it.
    Something like:
    SQL> select * from table; date;

    u cld set the following statements in sql*plus :
    sql>set time on
    sql>set timing on
    hope this solves ur problem.

  • 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.

  • Auto date entry in text field not working

    I have a text field named tdate, which is read-only and visible. I want Acrobat XI Pro to insert today's date when the form is opened. Here's what I have:
    javascript code:
    var f = this.getField("tdate");
    if (!f.value) f.value = util.printd ("mmmm d, yyyy", new Date());
    This code is inserted in Page properties / Actions /Page Open / run a JavaScript
    nothing happens when the page is opened.
    I have also tried, unsuccessfully, to enter this JavaScript code within the form field actions (mouse up), and nothing happens. I see from the forum comments that apparently this is successful for other users, but nothing seems to fill this text field. What am I doing wrong?
    Bill

    Thanks for your reply. I started to wonder whether or not the current field
    that I created had somehow been corrupted due to my fooling around so I
    deleted the field re-created it (and also randomly JavaScript debugger and
    deleted the code there) and now the current date appears in the text field.
    I wonder why Adobe doesn't simply allow the user to insert fields where the
    field is filled with either the current date or the current time instead of
    forcing the user to enter some JavaScript code. Not all users of Acrobat
    professional want to get that involved.
    Regards,
      Bill
    Bill McLachlan

  • Data from one text field to another text field on the next page

    Hi all,
    Hi I have a form, which has data coming in from the data binding, the thing is the data is mapped to a certain text field and if that text field is filled up it should be continued on to the other text field which is on the immediate page following it. the reason for using text field instead of  Subform and make it expandable is  the client does not want to change the position and structure of other fields following that field, they are o.k with the amount overflowed in to the next text field .
    is there any script for the same condition in Java script or form calc.
    Thanks in advance.
    de1209

    This is not as simple as it sounds. You will not be able to split the field up during the time of binding. The entire string must go into the field and only after it has completed the biinding can we change it around. A colleage of mine did this for an interactive field and it involved some pretty complicated code. Here is a link to her blog entry that describes what she did:
    http://blogs.adobe.com/lcdesigner/2008/07/an_example_of_splitting_text_a.html
    But that is only part of the problem.....once you split the information across two fields you will need to recombine it back into a single field so that the data that is submitted can represent it correctly again. So you will have to reverse the process in a presubmission step.
    Make sense?
    paul

Maybe you are looking for

  • Managing DCs in NWDI for different releases in same Client Project

    Hi all, We are working for a client and as part of the first phase of the project, we have developed Portal applications for one geography of the world. Currently maintenance and support for this phase 1 is going on. At the same time, phase 2 of the

  • How can i pass formatted text to PDF format

    i have tried to pass text to a txt file, however, it is unformatted and the text are shifted. Can anyone help me?

  • Custom Look&Feel problems with ComboBoxEditor

    hi, im trying to create a custom look and feel and have some problems with the ComboBoxEditor. the non-editable combobox works fine, but the editable makes problems. if i select an item from the dropdown, the value doesn't get updated in the editor a

  • EA6700 - Maximum Static IP Addresses

    Is there a limit on the number of Static IP Addresses on the EA6700?  There are currently three open entries called Static DNS 1, 2, 3.   I am using all three, and would like to add a fourth for the WAP300N Access Point.  Is there a way to add a four

  • Can't import catalog

    When i try to import a recent shoot from my desktop into lightroom, i can't select it because it's greyed out.