Fomating Dates

Hello
I'm having a bit of difficulty formating the current date.
I have a function that sets a variable "transDate" to the current date using Calendar.getInstance()
I then use my toString to print out some other stuff and the transDate variable. So it gives me the whole Gegorian Calendar. All i need is the "hour minute date month and year"
I have tried using the DateFormat but it tells me i can't format Calendar type.
I'll try muking some more but i thought there may be a real simple answer.
Thanks

It is the transDate you defined in setTransDate() is an "automatic" variable, it becomes garbage as soon as setTransDate() is done. The following code works
import java.util.Date;
import java.text.SimpleDateFormat;
class MyDateFormat {
    Date transDate;
    public void setTransDate()
     transDate = new Date();
    public String toString()
     SimpleDateFormat hope = new SimpleDateFormat("hh-mm-a-dd-MMM-yyyy");
     String date = hope.format(transDate);
     //     return("*Account Summary*\n*Account #:"+ acctNum + "\n*Account Name:"+ acctName + "\n*Account Balance:$"+ acctBalance +"\n*Account Type "+ acctType+ "\n*Last Transaction Date:" +date+"\n\n");
     return ("\n*Last Transaction Date:" +date+"\n\n");
    public static void main(String[] args) {
     MyDateFormat d = new MyDateFormat();
     d.setTransDate();
     System.out.println(d.toString());

Similar Messages

  • Convert string to fomated date

    I have a string type "dd/mm/yyyy", how can i convert it to "MMMddyyyy hh::mm:ss AM/PM" date format ??

    Calendar cal0 = Calendar.getInstance(); // today's date
                   SimpleDateFormat dateFormat = new SimpleDateFormat("MMMddyyyy hh::mm:ss AM/PM");          
                                                      cal0.add(Calendar.DATE,-0);
                                                      Calendar calx=cal0.getInstance();
              String date0 = dateFormat.format(cal0.getTime());
                                                                                                        System.out.println("Date "+date0);
    use this,.
    if there is any problem write it again,
    bye,
    Samir

  • Date Fomating with RFBIBL01

    Hi All,
    I have a Z Program which is using standard report RFBIBL01 for Uploading G/L Records. It creates a session when I run the session through SM35 the date field BSEG-ZFBDT is not getting populated. I am Getting "Formatting error in the field BSEG-ZFBDT; see next message" and "Fill in all required entry fields".
    Please let me know the approach i need to take to get it fixed. Do i Need to fomat this field, then how?
    Thanks,
    Vikas

    Hi,
    As per config ZFBDT is manditory you can check the data file whether its avialble for that record. If you not you
    need to provide them in file.
    You can ask Function to show you Feild status config for GL posting which will make you understand what all the fileds are manditory and optional.
    regards,
    Shanmugavel Chandrasekaran

  • MySQL date fomat with PHP

    I have a problem with format date stored in mySql db ( in the
    fied named 'dt_news') as dd-mm-yyyy.
    Now when I view my php page where I show all the records, I
    have the following type yyyy/mm/dd.
    Please help me to modify the attached code an have that
    result.

    Add to your code
    <?php
    function mysql2date($date){
    $temp = explode("-",$date);
    $newdate = $temp[2] . "/" . $temp[1] . "/" . $temp[0];
    return $newdate;
    Then instead of:
    <?php echo $row_View_News['dt_news']; ?>
    Use:
    <?php echo mysql2date($row_View_News['dt_news']); ?>
    This will change the mysql date format from YYYY-MM-DD to
    DD/MM/YYYY
    Gareth
    http://www.phploginsuite.co.uk/
    PHP Login Suite V2 - 34 Server Behaviors to build a complete
    Login system.

  • Date fomat

    Hi all,
    I need the output of date in format..
    October 25,2006.
    is there any function module to get the output in this format?
    Regards,
    ajith

    Hi again,
    1. 20061025
       ---> October 25, 2006.
    2. For this purpose, there in an independent subroutine in my program.
    3. just copy paste.
    REPORT abc.
    DATA : mname(20) TYPE c.
    PARAMETER : d TYPE sy-datum default Sy-datum.
    PERFORM getmonth USING d mname.
    WRITE :/ mname.
    *& Form getmonth
    text
    -->M text
    -->MNAME text
    FORM getmonth USING d mname.
      DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA : m(2) TYPE c.
      m = d+4(2).
      CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
      TABLES
      month_names = month_names
      EXCEPTIONS
      month_names_not_found = 1
      OTHERS = 2
      READ TABLE month_names INDEX m.
      IF sy-subrc = 0.
        mname = month_names-ltx.
      ENDIF.
      CONCATENATE MNAME D+6(2) ',' D(4) INTO MNAME SEPARATED BY SPACE.
    ENDFORM. "getmonth
    regards,
    amit m.

  • How to fomat a number cell to show up in Date format in FR in 11.1.1.3

    I developed a Financial Report using Essbase connection (Cannot create as Planning connection due to some restraints).
    I have a date type field in the report.The cell is displaying 20120123 which is fine since I am using the Essbase connection. But I would like it to be in a Date format (1/23/12) .
    Does anyone know as to how can I do this or its even possible ?
    Thanks in advance

    Hi,
    Have you tried the Date Function
    for example
    if the date is April 24:
    <<Date("dd-M-yy")>> displays 24-4-02
    <<Date("dd-MM-yy”)>> displays 24-04-02
    <<Date("dd-MMM-yy")>> displays 24-Apr-02
    <<Date("dd-MMMM-yy")>> displays 24-April-02

  • Data grid font fomating

    Hi everyone,
    I am trying to write some code that will allow me to set what
    the font looks like in a data grid. The font is going to chagne
    when a user chagnes something(i.e the user archives something i
    want the whole row to be italized based of a certain value that is
    set). How can this be done, and also in certain situations i only
    want a certain cell to change(i.e something new was added by
    another user i only want the first column in that row to be bold)
    how would that work...
    Thanks

    yea while i was working with VB , i was using data grids that lists the records those came from the access database.
    i'm using an access database again ,but with java codes i wanna do listing. im not making an applet, but a self GUI application, and dont know how to list the records. because in applets there's paint() method.in such an example of mine there's not.
    what can i do? if there is no data grid or something alike in java for self GUI applications, how can i list them as a whole in a frame?
    thanks

  • XML Publisher to Excel Report : Date format problem

    Hi,
    I am trying to create an Excel report with XML Publisher. I have an issue with the Date Fomatting.
    In the XML template, I have set the "Date" column in date format. But the excel output report "Date" column returns as "General text" (string) and it is sorted as text, not as date.
    Can anyone please help me out?
    Thanks!!!

    Hi,
    Did this post solve your problem? I have the same issue that I need to solve.
    I have an xsl-fo template with dates in it.
    The dates are in english.
    My excel is setup to use danish.
    When I export to excel it knows the month jan, feb, mar, apr, ... which are the same in danish and english.
    But months where it differs like may (danish maj) the cell is a general text instead of date.
    Is there anyway you can set/transform the date in the xsl-fo template so it does not care about the language in excel?
    Thank you in advance.
    BR Kenneth

  • My old MBP (2005) often crashes, freezes or shows grey screen at start up. Also track pad often does not work. I have re fomatted the HD and reinstalled system but to no avail. Genius bar says possible faulty HD, but suspect logic board, any ides any body

    My old 17" MBP (2005) often crashes, freezes or shows grey screen at start up. Also track pad often does not work. I have re fomatted the HD and reinstalled system but to no avail. Genius bar says possible faulty HD, but I suspect logic board. All checks out OK on the Apple Diagnostic bench. Can a Logic board go intermittant?? Any Ideas any body??

    Ive repaired 1000s of laptops over the years (translate: diagnose and replace parts).
    Its not that old, Ive owned 100s of laptops (most were free) ....some I still have are nearly 13 years old and still perfect, ....some extremely expensive ones died in under a year.
    other than becoming obsolete at some point, there isnt really any "will spoil on" data like Milk for solid state computer parts, ....alas.
    You can have a $5000 laptop die in 4 months, and a junker one keep kicking after 10 years.... Ive seen that firsthand countless times.
    Common logic dictates that "very expensive = long life" in computers,..... but all the repair people will tell you just the opposite.
    I know you have a gripe, I get that all too well honestly .

  • Converting Date Column to format MM/DD/YYYY in RPD

    Hi all,
    I have a requirement like converting a Date column to format MM/DD/YYYY in RPD. Any help as we are not supposed to use the BI Answers Data Fomat for showing this format.
    Thankyou,
    Edited by: [email protected] on May 10, 2010 11:49 PM

    Hi Saichand,
    I need the resulting column in DATE format only. The solution which you specified converts the datatype to character. Is there anyway to convert the format but not the datatype.

  • Putting fileinfo data on bottom of image for use in building a photobook for printing/binding

    I wonder if someone on here could help me with a problem I have? I am not a script expert by any means. The term "amateur" is probably pretty accurate!
    I have a few hundred pictures I want to include into a (to be printed) photobook. I want to put some key EXIF/Fileinfo data on the images so that they remind me of what file, when it was taken, with what and with what settings. I found an excellent script (by JJmack?) which does what i want with one exception. The script (below) puts the info on the image starting on the top left (0,0) and I really want it to start on the bottom left (so that it looks like a caption). I have tweaked the original 5 lines of data down to one line, and have reduced the font size but I simply do not have the skills to amend it to add the selected text to the bottom left.
    I was hoping that someone on this forum might be kind enough to help - not least because I am sure there are others who would want to the same thing? Or am I being a complete idiot and there is a simpler way to achieve what I am trying to do?
    Grateful for any help
    Michael.
    Apologies - can't find way to insert file so had to copy and paste:
    // This script was hacked from one I downloaded from the web JJMack 2008
    /*  Script to stamp copyright and camera data of shot   */
    // This script is supplied as is. It is provided as freeware.
    // The author accepts no liability for any problems arising from its use.
    <javascriptresource>
    <about>$$$/JavaScripts/StampExif/About=JJMack's Stamp Exif.^r^rCopyright 2009 Mouseprints.^r^rScript utility for action.^rNOTE:Add Text Layer with Fomatted EXIF Data!</about>
    <category>JJMack's Action Utility</category>
    </javascriptresource>
    // enable double-clicking from Mac Finder or Windows Explorer
    #target photoshop // this command only works in Photoshop CS2 and higher
    // bring application forward for double-click events
    app.bringToFront();
    // ensure at least one document open
    if (!documents.length) {
        alert('There are no documents open.', 'No Document');
    // if at least one document exists, then proceed
    else {
        main();
    // main - main function
    function main() {
        /* Null business owner */
        var Biz = "";
        var Owner = "";
        /* Variables You can hard code your business owner here */
        // var Biz = "Mouseprints";
        // var Owner = "John J McAssey";
            /*  sizeFactor influences text size 1 will use largest font 2 will half that font size    */
        var sizeFactor = 1.5;
            /* textX and TextY positions text placement 0 and 0 Top Left corner of image in pixels    */
        var textX = 0;                                   
        var textY = 0;   
        /* Internal Photoshop Text name                                */                               
            var fontName = "ArialMT";
        var fontName = "TimesNewRomanPSMT";
        var fontName = "Tahoma";
        /* Text Color                                        */
        textColor = new SolidColor;                       
        textColor.rgb.red = 255;
        textColor.rgb.green = 255;
        textColor.rgb.blue = 255;
        /* END Variables You can hard code your business owner here */
            // remember users Ruler avd Type Units and set ours
        var strtRulerUnits = app.preferences.rulerUnits;
        var strtTypeUnits = app.preferences.typeUnits;
        app.preferences.rulerUnits = Units.PIXELS;
         app.preferences.typeUnits = TypeUnits.PIXELS;
        /* Trying to figure out font size for the number of lines to cover the document height        */
        /* and getting setting text area to cover the document was a trip. Adobe Postscript trip    */
        /* I believe that 72 or 72.27 Point/Pica Size Photoshop Preference maybe I should see if    */
        /* I could retrieve it. Anyway mine is set to 72 Setting the document resolution taking        */
        /* the document width and dividing by 72 would probably yield number of characters that        */
        /* would fit in the document width. Setting the documents resolution comes into play        */
        /* with Photoshop text support. Using the documents height and dividing the by the number    */
        /* of lines of text I needed I hoped would yield the font size I needed. However that        */
        /* did not work the text area was correct the number of text lines did not fit. I needed    */
        /* to use a smaller font.  When the document resolution is set to 72 DPI and I set a text    */
        /* layer font size to 72 and the text area the number of pixels I want and observing        */
        /* Photoshop's text options bar there I see a one 1 to one relationship. 72 px = 72 px.        */
        /* If I set the documents resolution lower and set a Photoshop text layer font size to        */
        /* 72 px I see Photoshop scale the number to a lower number of pixels in the option bar.    */
        /* Just what I needed. Setting the Documents resolution to 60 DPI let the number of line    */
        /* I needed fit on the document. However Photoshop also scaled the text area I set down        */
        /* in size and that number of lines did not fit within that area. I needed to scale the        */
        /* text area up. Scaling the Text area up using 72/resolution did the trick...             */
            var testres = 60;
        res = app.activeDocument.resolution;
        if(res!=testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.v alue,testres); }
        /* Define var to be used to avoid undefined */
        var expTime = "";
        var expPgm = "";
        var expCmp = "";
        var mtrMode = "";
        var ev = "";
        var flshCode = "";
        var flshMode = "";
        var focLength = "";
        var Fstop = "";
        var ISO = "";
        var Model = "";
        var CameraModel = "";
        var Artist = "";
        var maxF = "";
        var wbMode = "";
        var phoTime = "";
        var picYr = "";
        var lens = "";
        var cpyrt = "";
        var remShutter = "";
        var remAperture = "";
        var remISO = "";
        var lat = "";
        var latRef = "";
        var lon = "";
        var lonRef = "";
        var docName = app.activeDocument.name;
        /* END var to be used to avoid undefined */
        try {   // get active document
            var doc = app.activeDocument;
        catch (e){
            alert("No Document Open..." );
        var exifInfo = "";
    try {
            // alert( "doc.info.exif=" + doc.info.exif );
            var numExifItems = doc.info.exif.length;
            // alert( "numExifItems=" + numExifItems );
                    for (var i = 0; i < doc.info.exif.length; i++){
                 exifInfo = exifInfo + doc.info.exif[i][0] + " = " + doc.info.exif[i][1] + "\r";
    /* ---------------------------------- Extracting Data I want to Stamp  formated ----------------------------------------------------------------------- */
                            checkThisItem(doc.info.exif[i][0], doc.info.exif[i][1])
                key=doc.info.exif[i][0];
                keyData=doc.info.exif[i][1];
                if (key == "Artist") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    Artist =("By " + keyData + "  ");
                 if (key == "Date Time Original") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    var phoTime = keyData;
                    var dateArray1 = phoTime.split(" ", 2);
                    phoTime = dateArray1[0];
                    phoHour = dateArray1[1];
                    var dateArray2 = phoTime.split(":");
                    var monthsArray = ["January","February","March","April","May","June","July","August","September","October", "November","December"];
                    phoTime = monthsArray[dateArray2[1]-1]+" " + dateArray2[2]+ ", " + dateArray2[0] +" @ " + phoHour;
                    var picYr = dateArray2[0];
                if (key == "Model") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    Model = (keyData + "  ");
                if (key == "Max Aperture Value") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    maxF = ("maxF " + keyData + " ");
                    maxF = ( keyData + " ");
                if (key == "Focal Length") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    focLength = ("@ " +keyData + "  ");
                if (key == "Exposure Program") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expPgm = (keyData + "  ");
                    if (expPgm == "Not defined") { expPgm = "Exposure Program Not Recorded  "; }
                if (key == "Exposure Bias Value") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expCmp = ("Bias " + keyData + "  ");
                if (key == "Metering Mode") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    mtrMode = (keyData + " Metering  ");
                if (key == "White Balance") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    wbMode = ("White Balance " + keyData + "  ");
                if (key == "ISO Speed Ratings") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    ISO = ("ISO " + keyData + "  ");
                    remISO = keyData;
                if (key == "Exposure Time") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    expTime = (" " + keyData + "  ");
                    remShutter = keyData;
                if (key == "F-Stop") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    Fstop = (" " + keyData + "  ");
                    remAperture = keyData;
                if (key == "Flash") {
                    // alert ("Key=" + key + " Data=" + keyData );
                    var flshCode = keyData;
                    var flshMode = "Flash Code=" + flshCode + "  ";
                    if(flshCode==1){var flshMode = "Firing Flash   ";}
                    if(flshCode==9){var flshMode = "Firing Flash   ";}
                    if(flshCode==13){var flshMode = "Firing Flash   ";}
                    if(flshCode==15){var flshMode = "Firing Flash   ";}
                    if(flshCode==25){var flshMode = "Firing Flash   ";}
                    if(flshCode==29){var flshMode = "Firing Flash   ";}
                    if(flshCode==31){var flshMode = "Firing Flash   ";}
                    if(flshCode==65){var flshMode = "Firing Flash   ";}
                    if(flshCode==69){var flshMode = "Firing Flash   ";}
                    if(flshCode==71){var flshMode = "Firing Flash   ";}
                    if(flshCode==73){var flshMode = "Firing Flash   ";}
                    if(flshCode==77){var flshMode = "Firing Flash   ";}
                    if(flshCode==79){var flshMode = "Firing Flash   ";}
                    if(flshCode==89){var flshMode = "Firing Flash   ";}
                    if(flshCode==93){var flshMode = "Firing Flash   ";}
                    if(flshCode==95){var flshMode = "Firing Flash   ";}
                    if(flshCode==0){var flshMode = "without Flash   ";}
                    if(flshCode==16){var flshMode = "without Flash   ";}
                    if(flshCode==24){var flshMode = "without Flash   ";}
                    if(flshCode==88){var flshMode = "without Flash   ";}
                    if(flshCode==32){var flshMode = "No Flash   ";}
                if (key == "GPS Latitude") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lat= ("Lat: " + keyData.replace(/\.00/g,'') + " ");
                if (key == "GPS Latitude Ref") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    latRef= (keyData + "  ");
                if (key == "GPS Longitude") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lon= ("Lon: " + keyData.replace(/\.00/g,'') + " ");
                if (key == "GPS Longitude Ref") {
                    //alert ("Key=" + key + " Data=" + keyData );
                    lonRef= (lon + keyData + "  ");
            /* Copyright Year(s) */
            var thisYr, toDay       
            var toDay = new Date();
            var thisYr = toDay.getYear() + 1900;
            if(picYr!="" && thisYr!=""){ var cpyrt =  picYr + "-" + thisYr + "  ";}
            if(picYr=="" && thisYr!=""){ var cpyrt =  thisYr + "  ";}
            if(picYr==thisYr){ var cpyrt =  thisYr + "  ";}
            /* For cameras that don't set Artist or set unknown in the Exif substitute Owner if set */
            if(Artist=="" && Owner!=""){var Artist = "By  " + Owner + "   ";}
            if(Artist=="By unknown  " && Owner!=""){var Artist = "By  " + Owner + "   ";}
            /*  Lens info  */
            xml = app.activeDocument.xmpMetadata.rawData;
            lensOffset = xml.indexOf("<aux:Lens>") + "<aux:Lens>".length;
            if(lensOffset > 0) {
                lens = xml.substr(lensOffset, xml.length - lensOffset);
                lens = lens.substr(0,lens.indexOf("</aux:Lens>"));
            /* Hack for my cameras with fixed lens */
            if(lens=="" && Model=="E990  "){var lens = "9-28mm";}
            if(lens=="" && Model=="E-20,E-20N,E-20P  "){var lens = "9-36mm";}
            if(lens=="" && Model=="E-10  "){var lens = "9-36mm";}
            if(lens=="" && Model=="E-10          "){
                var Model = "E-10  ";
                var lens = "9-36mm";
            if(lens=="" && Model=="Canon PowerShot SD700 IS  "){var lens = "5.8-23.2mm";}
            if(lens!=""){var lens = lens + "  ";}
            else {var lens = "Unknown Lens  ";}
            /* Hack for my ultra compact cameras program mode not recorded */
            if(Model=="Canon PowerShot SD700 IS  "){var expPgm = "Ultra Compact Camera  ";}
            //alert (remShutter + " " + remAperture + " " + remISO);
                    ev = calcEV(remShutter, remAperture, remISO);
    /* ---------------------------------- END Extracting Data I want to Stamp  formated -------------------------------------------------- */
        catch (e){
            alert("No EXIF data exists..." );
        if ( exifInfo == "" ) {
            alert( "No EXIF data exists..." );
        else {
            // alert( "exifInfo=" + exifInfo );
            text_layer = doc.artLayers.add();                        // Add a Layer
            text_layer.name = "EXIF Stamp";                            // Name Layer
            text_layer.kind = LayerKind.TEXT;                        // Make Layer a Text Layer
            text_layer.textItem.color = textColor;                        // set text layer color
    /* Do not set TextType to Pargarph Text for StampEXIF so action can position text layer
             text_layer.textItem.kind = TextType.PARAGRAPHTEXT;                // Set text layers text type
            text_layer.textItem.font = fontName;                        // set text font
            text_layer.blendMode = BlendMode.NORMAL                        // blend mode
            text_layer.textItem.fauxBold = false;                        // Bold
            text_layer.textItem.fauxItalic = false;                        // Italic
            text_layer.textItem.underline = UnderlineType.UNDERLINEOFF;            // Underlibn
            text_layer.textItem.capitalization = TextCase.NORMAL;                // Case
            text_layer.textItem.antiAliasMethod = AntiAlias.SHARP;                // antiAlias
    //        var fontSize = Math.round((doc.height- textY) / ((numExifItems +1) * sizeFactor)); // Calulate font size to use Item nomber + last \r
            /* Calulate font size to use for StampExit keep size same for landscape and portrait base on document size */
            if (doc.width >= doc.height) {var fontSize = Math.round(doc.height / (30 * sizeFactor));}
            else {var fontSize = Math.round(doc.width / (30 * sizeFactor));}
            if (fontSize<10){fontSize=10};                            // don't use Font size smaller then 10
            text_layer.textItem.size = fontSize;                        // set text font Size
    //        text_layer.textItem.position = Array(textX, textY );                // set text layers position in and down
            text_layer.textItem.position = Array(textX, (textY + fontSize ));        // set text layers position in and down for Stamp add in fontsize
            textWidth = ((doc.width - textX) * 72/testres );                // Text width document width - offset
            textHeight = ((doc.height - textY) * 72/testres );                // Text height document height - offset
    /* Do not set Text Area for StampEXIF so action can position text layer
            text_layer.textItem.width = textWidth;                        // set text area width
            text_layer.textItem.height = textHeight;                    // set text area height
             alert(
            "res=" + res + " sizeFactor=" + sizeFactor + " numExifItems=" + numExifItems
            + "\r" + "fontsize=" + fontSize + " font=" +fontName
            + "\r" + "Image area width=" + doc.width + " height=" + doc.height
            + "\r"    + "text area width=" + textWidth + " height=" + textHeight
            + "\r"    + "Text Position top left=" + textX + "," + textY
            + " bottom right=" + (textX + textWidth )+ "," + (textY +  textHeight )
            try{
                text_layer.textItem.contents = exifInfo;
            catch (er) {
                alert("Error Setting Contents...");
    /* -----------------------------------------  Data Stamp  format ----------------------------------------------------------------------- */
            if (!app.activeDocument.info.copyrightNotice=="") {var Notice = app.activeDocument.info.copyrightNotice; }
            else { var Notice = "Copyright \u00A9 " + Biz  + " " + cpyrt; }   
            if (lat!="" && lon!="") { gps = "\r" + lat +latRef + lon + lonRef;}
            else {gps = ""; }
            text_layer.textItem.contents =  docName + " " + Model + lens + ISO + expTime + Fstop;
            if (app.activeDocument.info.instructions == "" ) {
                app.activeDocument.info.instructions = docName + " " + Model  + lens + ISO  + expTime + Fstop;
        if(res != testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.v alue,res); }
        app.preferences.rulerUnits = strtRulerUnits;
        app.preferences.typeUnits = strtTypeUnits;
    // END - main function
    // calcEV()
    function calcEV(shutter, aperture, iso) {
        evString = new String("");
        isoValue = new Number(0);
        shutterValue = new Number(0);
        apertureValue = new Number(0);
        evValue = new Number(0);
        apertureValue = aperture;
        apertureValue = apertureValue.substr(2,apertureValue.length -2); // Strip off "f/"
        shutterValue = shutter;
        shutterValue = shutterValue.substr(0,shutterValue.indexOf(" ")); // Strip off ending " sec"
        if ( shutterValue.indexOf("/") != -1) {
            topShutter = shutterValue.substr(0,shutterValue.indexOf("/"));
            bottomShutter = shutterValue.substr(shutterValue.indexOf("/") + 1,shutterValue.length -(shutterValue.indexOf("/") + 1));
            shutterValue = topShutter / bottomShutter;
        isoValue = iso;
        //alert ("apertureValue = " + apertureValue +  " shutterValue = " + shutterValue + " isoValue = " + isoValue );
        if (isoValue>0 && shutterValue>0 && apertureValue>0) {
            evValue = Math.LOG2E * Math.log(Math.pow(apertureValue, 2) * (1 / shutterValue) * (100 / isoValue));
            evValue = Math.round(evValue * 10) / 10;
            evString = "EV " + evValue;
        return evString;;
    function checkThisItem(key, keyData) {
        // alert("Key=" + key + " Data=" + keyData );

    I wrote that script to be used within an Action.  The Action uses the script to add the text layer. The text layer becomes the current active layer.  The action can then position the layer anywhere over the document by aligning the layer to a selection.  Also add a layer style like set fill to 0 and adding a drop shadow and emboss. That is the un-expanded step below the set current layer is setting a style and is lengthy.
    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Example
    Download

  • Urgent help with simple BPEL process for reading data from database

    Hello there,
    I need help with BPEL project.
    i have created a table Employee in Database.
    I did create application, BPEL project and connection to the database properly using Database Adapter.
    I need to read the records from the database and convert into xml fomat and it should to go approval for BPM worklist.
    Can someone please describe me step by step what i need to do.
    Thx,
    Dps

    I have created a table in Database with data like Empno,name,salary,comments.
    I created Database Connection in jsp page and connecting to BPEL process.
    It initiates the process and it goes automatically for approval.
    Please refer the code once which i created.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="java.util.Map" %>
    <%@page import="com.oracle.bpel.client.Locator" %>
    <%@page import="com.oracle.bpel.client.NormalizedMessage" %>
    <%@page import="com.oracle.bpel.client.delivery.IDeliveryService" %>
    <%@page import="javax.naming.Context" %>
    <%@page import="java.util.Hashtable" %>
    <%@page import="java.util.HashMap" %>
    <%@ page import="java.sql.*"%>
    <%@ page import= "jspprj.DBCon"%>
    <html>
    <head>
    <title>Invoke CreditRatingService</title>
    </head>
    <body>
    <%
    DBCon dbcon=new DBCon();
    Connection conn=dbcon.createConnection();
    Statement st=null;
    PreparedStatement pstmt=null;
    Hashtable env= new Hashtable();
    ResultSet rs = null;
    Map payload =null;
    try
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "opmn:ormi://localhost:port:home/orabpel");//bpel server
    env.put("java.naming.security.principal", "username");
    env.put("java.naming.security.credentials", "password");//bpel console
    Locator locator = new Locator("default","password",env);
    IDeliveryService deliveryService =
    (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    // construct the normalized message and send to Oracle BPEL Process Manager
    NormalizedMessage nm = new NormalizedMessage();
    java.util.HashMap map = new HashMap();
    st=conn.createStatement();
    out.println("connected");
    String query1="Select * from EMPLOYEE";
    rs=st.executeQuery(query1);
    /*reading Data From Database and converting into XML format
    so that no need of going to BPEL console and entering the details.
    while (rs.next()){
    String xml1 = "<AsynchBPELProcess1ProcessRequest xmlns='http://xmlns.oracle.com/AsynchBPELProcess1'>"+
    "<Empno>"+rs.getString(1)+"</Empno>"+
    "<EmpName>"+rs.getString(2)+"</EmpName>"+
    "<Salary>"+rs.getString(3)+"</Salary>"+
    "<Comments>"+rs.getString(4)+"</Comments>"+
    "</AsynchBPELProcess1ProcessRequest>";
    out.println(xml1);
    nm.addPart("payload", xml1 );
    // EmployeeApprovalProcess is the BPEL process in which human task is implemented
    deliveryService.post("EmployeeApprovalProcess", "initiate", nm);
    // payload = res.getPayload();
    out.println( "BPELProcess CreditRatingService executed!<br>" );
    // out.println( "Credit Rating is " + payload.get("payload") );
    //Incase there is an exception while invoking the first server invoke the second server i.e lsgpas13.
    catch(Exception ee) {
    //("BPEL Server lsgpas14 invoking error.\n"+ee.toString());
    %>
    </body>
    </html>
    Its working fine.And i want it for Bulk approvals.please help me step by step procedure if any other way to implement this.

  • Converting Date-Time to Long Date in a string that is stored in a formula

    The following are 2 verions of formulas that I've tried in placing the long date on a report.  I want the JUD_T_MEETING_NOTICE.MEETING_DATE to be displayed on the letter if Outcome_ID = 3.00 as April 29, 2009.  The field's fomat in the table is 04/29/2009 and neither of the formula's below worked.  I tried formatting the date as a separte formula, as shown in Formula #2 below, but the formatting defaults to the original DataType.  Anyone have any ideas on how to format the date within the string in the formula?
    FORMULA #1:
    IF {JUD_T_MEETING_NOTICE.FK_OUTCOME_ID} = 3.00
    THEN 'I received the enclosed report(s) for review.  To resolve this matter, you must contact the office at ' & {@HallPhone} & ' to schedule a meeting to discuss the incident with me.  This meeting must occur by ' & DATETIMETODATE({JUD_T_MEETING_NOTICE.MEETING_DATE}) & '.  If you have a conflict with this deadline, please let me know as soon as possible to make alternative meeting arrangements.'
    ELSE IF {JUD_T_MEETING_NOTICE.FK_OUTCOME_ID} = 9.00
    THEN 'You missed your scheduled meeting.'
    FORMULA #2:
    IF {JUD_T_MEETING_NOTICE.FK_OUTCOME_ID} = 3.00
    THEN 'I received the enclosed report(s) for review.  To resolve this matter, you must contact the office at ' & {@HallPhone} & ' to schedule a meeting to discuss the incident with me.  This meeting must occur by ' & ({@FormatMeetingDate}) & '.  If you have a conflict with this deadline, please let me know as soon as possible to make alternative meeting arrangements.'
    ELSE IF {JUD_T_MEETING_NOTICE.FK_OUTCOME_ID} = 9.00
    THEN 'You missed your scheduled meeting.'

    Assuming JUD_T_MEETING_NOTICE.MEETING_DATE is a date field, modify your formula to:
    totext(({JUD_T_MEETING_NOTICE.MEETING_DATE}),"MMMM dd, yyyy")
    If it is not a date field but a string, then
    totext(cdate(JUD_T_MEETING_NOTICE.MEETING_DATE ),"MMMM dd, yyyy")

  • 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);

  • I Need to change Date Format in BEx report

    Hi Experts,
    i Need display with required values with following symbols in BEx report # and Date format change as per client requirement. Without any VB Code.
    Let me know solution for this.
    By
    ANR

    My actual requirement,
    by default date format display in BEx Reports MM/DD/YYYY fomat, but i want change DD/MM/YYYY format without using any VB macro and also instead of displaying "#"  i need display "0" (Zero).
    let me know the solution.
    by
    ANR
    Anybody ....
    Message was edited by: ANR

Maybe you are looking for

  • PAYMENT IDOC PEXR2002, Authorization, setup procedures.

    Dear Members, Can somebody throw some light on how to learn the following requirements: 1) Creation of Outgoing Payment Idoc in PEXR2002 format. (Also would like to know what are the different types of payment run) 2) How to setup or trigger the Auth

  • How to get the tax break up??

    hello experts I want to know how to get the Tax break ups In Sales Order Or purchase order under the conditions tab as it is not stored in Database. And The Text Fields In Miro screen where it is stored In Db and  how can i retrieve it ??? How to ret

  • I have the problem with the eFax Create Account button being grayed out for my newly purchased 6525.

    I have the problem with the eFax Create Account button being grayed out for my newly purchased 6525. Can you help?

  • E65 and GPS Navman

    Hi, I have a Nokia E65 and a GPS bluetooth Navman 4410. The GPS's code to pair is NAVMAN. But when I try to pair them, I only can write numbers (no letters). Could you help me? Thanks a lot.

  • Deleting what I believe are cache files.

    After editing images in PSE8 and I try to go back into iPhoto 09 I get the spinning wheel for about 20 secs before it lets me into Events. I've noticed that in iPhoto Library / show packages / there are two folders, named Modified and Originals. Thes