Time duration numeric format

Hi all,
I want to format a number in seconds as a time duration (hh:mm:ss). It must
not be formatted as an absolute time, therefore a number of zero should not
give "02:00:05" in the formatted output. It is a duration, therefore a
number of 40 (seconds) should be formatted as "00:00:40", 70 should be
"00:01:10", etc. I want to use this in a control on the front panel to
input a time duration.
Is this possible in LabVIEW? Any sugestions?
Gys van Zyl

Thanks,
I can't believe I missed it. I kept looking for settings under "Date &
Time" format!
"Greg McKaskle" wrote in message
news:[email protected]..
> > I want to format a number in seconds as a time duration (hh:mm:ss). It
must
> > not be formatted as an absolute time, therefore a number of zero should
not
> > give "02:00:05" in the formatted output. It is a duration, therefore a
> > number of 40 (seconds) should be formatted as "00:00:40", 70 should be
> > "00:01:10", etc. I want to use this in a control on the front panel to
> > input a time duration.
> >
> > Is this possible in LabVIEW? Any sugestions?
> >
>
>
> Look at using the format called Relative Time.
>
> Greg McKaskle
>

Similar Messages

  • Convert channel display format from time to numeric in a script

    I am trying to convert the Display format of a channel that contains time values (mm/dd/yyyy hh:nn:ss.ffff) from Time to Numeric. I know I can do this in the properties section of the data portal but I would like to do it in a script. I want to be able to automatically convert it without having to manually do it each time I import new data. What syntax is needed for this? 
    I've already tried the ChnPropSet (and ChnPropValSet) commands but it doesn't change the Display format after I run the script. Thanks for all your help. 
    Solved!
    Go to Solution.

    Hi Steinmeister,
    i've found a way. You can use the "ChnCalculate"-Function but you must store it to a new channel.
    Dim oGrp, oChn
    Dim sChn
    'iterate over all channels
    For Each oGrp In Data.Root.ChannelGroups
    For Each oChn In oGrp.Channels
    sChn = transformTimeChnToNum(oChn)
    If (sChn <> "") Then
    Call ChnCopy(oGrp.Name & "/" & sChn, oGrp.Name & "/" & oChn.Name)
    Call ChnDel(oGrp.Name & "/" & sChn)
    End If
    Next
    Next
    'function for transforming the channel
    Function transformTimeChnToNum(oChannel)
    transformTimeChnToNum = ""
    If (oChannel.DataType <> DataTypeChnDate) Then
    Exit Function
    End If
    transformTimeChnToNum = oChannel.Name & "_num"
    Call ChnCalculate("Ch(""" & oChannel.ChannelGroup.Name & "/" & transformTimeChnToNum & """)=Val(Ch(""" & oChannel.ChannelGroup.Name & "/" & oChannel.Name & """))")
    End Function

  • How can I tell that a default numeric format has been applied to a numeric limit step?

    I am working on generating custom HTML code for our test systems in order to reduce the 'footprint' of the standard HTML entries for numeric limits, multiple-numeric limit steps etc....
    For a Numeric Limit step, I can set the Numeric Format via the 'Limits' tab and select the pulldown arrow to select any format.  Does TestStand actually save this information with the step so I could possibly use this later?   I ask this because my modifications are within the 'ModifyReportEntry' Callback.   When I am modifying the code to generate new HTML within this callback, I have no idea if the developer has selected a Numeric Format for a given step OR simply left it as DEFAULT.
    To make matters more confusing, here is some more information....
    When I pause the execution in the callback I notice the following:
    Case 1:  User has selected a Numeric Format ( this example I will say 3 digits of precision ) %.3f. for a numeric limit step.
    Parameters.Result.Limits.Low = 10.000
    Parameters.Result.Limits.High = 20.000
    Parameters.Result.Numeric = 15.657
    Notice the numeric data is ALREADY formatted! Great, I can simply use this to generate my custom HTML table for the numeric limit step.
    Case 2 : User has left the numeric format to <Default> for the step.
    Parameters.Result.Limits.Low = 10
    Paramters.Result.Limits.High = 20
    Parameters.Result.Numeric = 15.65713515155
    Numeric data is NOT formatted.  I know that TestStand will apply the Default Numeric Format that is configured in the report options when it writes the report but since I am doing a custom report I am stuck.
    My question is how can I possibly tell that the data has already been formatted by TestStand in the ModifyReportEntry callback?  Is there some flag that I could check or anything?
    I do notice that the Parameters.ReportEntry string contains TestStand's default HTML code for the step and this is already properly formatted.. so as a possible workaround I could 'pick out' the data from this string but this is slow and time consuming.
    Thanks
    PH

    PH,
    You can find out if the numeric format has changed using the TestStand API. I use the following statement in my step's post-expression to find out the numeric format that TestStand uses for the step.
    Step.Limits.Low.NumericFormat
    If the string returned is an empty string, then it is the default format, otherwise, it's the one specified in the string.
    Hope this helps.
    Raj
    National Instruments
    Applications Engineer

  • How to display time duration (NOT dates) with an input mask in a JTable?

    Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip.
    They are stored as type float internally eg. startPosition = 72.7 seconds.
    However I wish to display on screen in the table in HH:mm:ss:S format. eg. 00:01:12:7. The user can edit the cell and input values to update the internal member fields.
    Problem: I am finding it very difficult to implement this - what with the interactions of MaskFormatter, DefaultCellEditor etc.
    Also using SimpleDateFormat and DateFormatter does not work as they insist on displaying the day, month, year also in the table cell.
    Taking the Swing Tutorial TableFTFEditDemo example as a template,
    (http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableFTFEditDemo)
    does anyone know how to do this?
    I can post my (buggy) modifications to the example code - if it would help.
    Appreciate any help.
    thanks,
    Anil

    Here are my modifications to the TableFTFEditDemo example. If you run it, you get an exception
    like java.lang.NumberFormatException: For input string: "18:00:03.500"
    The two modified classes are taken from the Tutorial and are listed below:
    =================
    * IntegerEditor is a 1.4 class used by TableFTFEditDemo.java.
    import javax.swing.AbstractAction;
    import javax.swing.BorderFactory;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFormattedTextField;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.KeyStroke;
    import javax.swing.SwingUtilities;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Toolkit;
    import java.text.DateFormat;
    import java.text.NumberFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.text.DateFormatter;
    import javax.swing.text.DefaultFormatterFactory;
    import javax.swing.text.MaskFormatter;
    import javax.swing.text.NumberFormatter;
    class TimeRenderer {
         float seconds;
         TimeRenderer(String str) {
              int hSec = Integer.parseInt(str.substring(0,2)) * 60 * 60;
              int mSec = Integer.parseInt(str.substring(2,4)) * 60;
              int sSec = Integer.parseInt(str.substring(4,6));
              float tSec = Integer.parseInt(str.substring(6,7))/10.0F;
              seconds = hSec + mSec + sSec + tSec;
    * Implements a cell editor that uses a formatted text field to edit Integer
    * values.
    public class IntegerEditor extends DefaultCellEditor {
         JFormattedTextField ftf;
         static Date zeroTime = new Date(0L);
         private boolean DEBUG = true;
         SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.S");
         MaskFormatter maskFo = new MaskFormatter("##:##:##.#");
         protected MaskFormatter createFormatter(String s) {
              MaskFormatter formatter = null;
              try {
                   formatter = new MaskFormatter(s);
              } catch (java.text.ParseException exc) {
                   System.err.println("formatter is bad: " + exc.getMessage());
                   System.exit(-1);
              return formatter;
         public IntegerEditor(int min, int max) throws ParseException {
              super(new JFormattedTextField(new MaskFormatter("##:##:##.#")));
              ftf = (JFormattedTextField) getComponent();
              // Set up the editor for the cells.
              ftf.setFormatterFactory(new DefaultFormatterFactory(new DateFormatter(sdf)));
              ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);
              // React when the user presses Enter while the editor is
              // active. (Tab is handled as specified by
              // JFormattedTextField's focusLostBehavior property.)
              ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
              ftf.getActionMap().put("check", new AbstractAction() {
                   public void actionPerformed(ActionEvent e) {
                        if (!ftf.isEditValid()) { // The text is invalid.
                             ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                             ftf.setBackground(Color.PINK);
                             ftf.postActionEvent(); // inform the editor
                        } else
                             try { // The text is valid,
                                  ftf.commitEdit(); // so use it.
                                  ftf.postActionEvent(); // stop editing
                             } catch (java.text.ParseException exc) {
         // Override to invoke setValue on the formatted text field.
         public Component getTableCellEditorComponent(JTable table, Object value,
                   boolean isSelected, int row, int column) {
              JFormattedTextField ftf = (JFormattedTextField) super
                        .getTableCellEditorComponent(table, value, isSelected, row, column);
              System.out.println("value:" + value);
    //          long milliseconds =(long) (Float.parseFloat(value.toString()) * 1000);
              long milliseconds =(long) (((Float) value).floatValue() * 1000);
              Date dt = new Date(milliseconds);
              ftf.setValue(dt);
              return ftf;
         // Override to ensure that the value remains an Integer.
         public Object getCellEditorValue() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              Object o = ftf.getValue();
              try {               
                   Calendar cal = Calendar.getInstance();
                   cal.setTime((Date)o);
                   float seconds = cal.getTimeInMillis()/1000.0F;
                   return sdf.format(o);
                   //return new Float(seconds);
              } catch (Exception exc) {
                   System.err.println("getCellEditorValue: can't parse o: " + o);
                   exc.printStackTrace();
                   return null;
         // Override to check whether the edit is valid,
         // setting the value if it is and complaining if
         // it isn't. If it's OK for the editor to go
         // away, we need to invoke the superclass's version
         // of this method so that everything gets cleaned up.
         public boolean stopCellEditing() {
              JFormattedTextField ftf = (JFormattedTextField) getComponent();
              if (ftf.isEditValid()) {
                   try {
                        ftf.commitEdit();
                   } catch (java.text.ParseException exc) {
              } else { // text is invalid
                   ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
                   ftf.setBackground(Color.PINK);
                   return false; // don't let the editor go away
              return super.stopCellEditing();
    //=====================================================
    * TableFTFEditDemo.java is a 1.4 application that requires one other file:
    *   IntegerEditor.java
    import javax.swing.JFrame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.text.ParseException;
    * This is exactly like TableDemo, except that it uses a
    * custom cell editor to validate integer input.
    public class TableFTFEditDemo extends JPanel {
        private boolean DEBUG = false;
        public TableFTFEditDemo() throws ParseException {
            super(new GridLayout(1,0));
            JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Set up stricter input validation for the integer column.
         //   table.setDefaultEditor(Float.class,
           //                        new IntegerEditor(0, 100));
         //If we didn't want this editor to be used for other
         //Integer columns, we'd do this:
         table.getColumnModel().getColumn(3).setCellEditor(
              new IntegerEditor(0, 100));
            //Add the scroll pane to this panel.
            add(scrollPane);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            private Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Float(5.7), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Float(3.5), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Float(2.9), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Float(20.8), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Float(10.5), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                 Object obj = getValueAt(0, c);
                 System.out.println("getColumnClass.obj:" + obj);
                return obj.getClass();
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         * @throws ParseException
        private static void createAndShowGUI() throws ParseException {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TableFTFEditDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableFTFEditDemo newContentPane = new TableFTFEditDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    try {
                             createAndShowGUI();
                        } catch (ParseException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
    }

  • Set Date/Currency/Numeric Format in WebIntelligence - Regional Settings

    We have migrated from BOE R2 to BOE R3.1, and our users have observed that the date & numeric format is not localized to spanish (Spain).
    How can Web Intelligence regional settings be configured to all the users (not editing personal configuration of every user)?
    For instance the time is indicated with AM/PM instead of 24h time format and the numbers are separated by comma (,) and not by dot (.).
    Example 11,816,138 instead of 11.816.138
    Thank you!

    Problem solved, the fp 1.3 installation did not complete.
    We reinstalled it and now everything works properly.

  • Calculating hours in numerical formats between 2 business days, calculated column

    Hi there,
    I need to calculate how many hours are between 2 days only including business days, outputting in numerical format (ex. 7.3). 
    I've been using this formula to output how many weekdays are between 2 days.
    =IF(AND((WEEKDAY(CompletedTimeStamp,2))<(WEEKDAY(,2)),((WEEKDAY(Created,2))-(WEEKDAY(CompletedTimeStamp,2)))>1),(((DATEDIF(Created,CompletedTimeStamp,"D")+1))-(FLOOR((DATEDIF(Created,CompletedTimeStamp,"D")+1)/7,1)*2)-2),(((DATEDIF(Created,CompletedTimeStamp,"D")+1))-(FLOOR((DATEDIF(Created,CompletedTimeStamp,"D")+1)/7,1)*2)))
    The problem with this is if the 2 dates are on the same day, it outputs "1". I need it to output the amount of hours then / by 24 to give me ".7"  instead.
    Is there anything I can do to convert this current formula to give me hours instead of days?
    Thanks,
    Terence

    The DATEDIF is rounding to the nearest day.
    Try this:
    =IF(AND((WEEKDAY(CompletedTimeStamp,2))<(WEEKDAY(,2)),((WEEKDAY(Created,2))-(WEEKDAY(CompletedTimeStamp,2)))>1),(((CompletedTimeStamp-Created+1))-(FLOOR((CompletedTimeStamp-Created+1)/7,1)*2)-2),(((CompletedTimeStamp-Created+1))-(FLOOR((CompletedTimeStamp-Created+1)/7,1)*2)))
    -1
    Then above will return fractions of days, i.e.  5.5 days. Multiply this by 24 for hours.
    I think there is a extra "+1" in the above example somewhere, so I added a minus 1 to get back the correct value.
    Hi.. Mike.. I am trying to use this calcuation.. its renndering "time being used 3.3".. I need it to calcuate a work day as 8 hrs  so if
    Start Date= 9/12/2014 9:00am
    End Date= 9/16/2014 5:00 pm
    should be 3 (8 hr work days)  any way I can fix this?
    Thanks in advance for your help.
    Mike Smith TechTrainingNotes.blogspot.com

  • Whats the datatype for the time in the format mm:ss.ms

    Hello Sir,
    I wanted to create a table with a field called time.
    what should be the datatype for this field contains the value as in the format mm:ss.ms(04:53.0).
    waiting for ur reply.
    regards
    pannar

    Actually, i need to read some time values from excel sheet and store them into a table. it should contains the field time with the value something like
    (05:21.1) ie mm:ss.ms).
    if i put varchar2, i will be in trouble at the time of querying the table with some condition like fetch the records only the time duration less than 3 mins or something like that!
    in this case, what data type finally fits to do this?

  • Time Duration tracking

    Hi ALL,
    I need to get total time duration of my user in my application. I got maximum time duration he has spent for a month from the below sample query .
    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
    Date parseFinalTime=null;
    String totalDuration = "";
    long totDuration=0;
    String siteDuration="";
    String masterquery = new StringBuffer("SELECT max(TSIE52_SESSION_DURATION)  from STSIE52_USER_SESSION ").toString();
    ResultSet subResultSet = getResultSet(connection, masterquery);
    while (subResultSet.next()) {
    parseFinalTime = sdf.parse(subResultSet.getString(1));
    totDuration =parseFinalTime.getTime();
    totalDuration = sdf.format(new Date(totDuration));
    System.out.println("siteDuration---------------->::" +totalDuration);
    }The output I got as below:
    siteDuration---------------->::00:00:24
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:09
    siteDuration---------------->::00:00:14
    siteDuration---------------->::00:51:33
    siteDuration---------------->::00:16:42
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:25
    siteDuration---------------->::00:00:05
    siteDuration---------------->::00:00:10
    siteDuration---------------->::00:00:09
    siteDuration---------------->::00:03:02
    siteDuration---------------->::00:00:18
    siteDuration---------------->::00:00:11
    I need to total all the times mentioned above and get the result as total duration time. How it is possible in java? Or is any other way that the desired output can be got from the sql query itself. Appreciate your help.

    JAMon does exactly this and more. Whatever label you pass to the start method later shows up in a report with the times aggregated (hits,total time,avg time, min time, max time and more). jamon is easy to use, open source and fast. For servlets you can use the jamon servlet filter and monitor these stats for each servlet without any code changes on your end (just add to your web.xml and make jamon.jar available).
    jamon 2 was just released this weekend and it has some new powerful capabilities.
    Having said that I would think your particular case would be better solved by the database with a group by clause.
    http://www.jamonapi.com
    Something like the following could work. Note I am also timing the code with jamon.
    import com.jamonapi.*;
    Monitor mon=MonitorFactory.start("myCode");
    long totDuration=0;
    String masterquery = new StringBuffer("SELECT max(TSIE52_SESSION_DURATION)  from STSIE52_USER_SESSION ").toString();
    ResultSet subResultSet = getResultSet(connection, masterquery);
    while (subResultSet.next()) {
    parseFinalTime = sdf.parse(subResultSet.getString(1));
    MonitorFactory.add("totalDuration", "duration",totDuration);
    mon.stop();

  • Incorrect time duration for songs

    I just added a few mp3s to my iTunes (8.1.1) library, and while the songs are around 3-4 minutes long each, the time duration listed is more than 25 minutes for each of the songs. The songs play fine, and they stop at the proper point (3-4 minutes in), the length is just listed wrong... how can I fix this? It's messing with my total time count, and it's just rather annoying altogether. Thanks for any help!

    Welcome to the forums
    One thing you could do, is set the correct Stop time for the track (in Get Info), and the track will stop playing at the correct point.
    If you want to make the total time correct also, then :
    1. set the correct Stop time (above)
    2. convert the MP3 (iTunes Preferences / Importing) to another format, or to MP3 again (you will lose a little quality I'm afraid)
    The converted track will now have the correct Stop time AND length.

  • How to calculate the time duration on a datetime column?

    Hi guys,
    I've done some search on this forum and everywhere else but I can't seem to get this right, at the beggining it sounded like something very simple to accomplish, for the instance with Excel but I'm struggling to get it to work with Crystal Reports on Microsoft Visual Studio 2008.
    I have a datetime column (SQL Server 2000) that I wanted to calculate the the time duration on the report group footer, unfortunatelly the built-in SUM function cannot be applied and I've tried several formulas that I've found on the internet without any luck. I'm using a datetime column to store only the time because I'm stuck with SQL Server 2000 which doesn't have a time data type.
    Would you guys know how to do it by any chance?
    Some sample code I've tried: http://www.minisolve.com/TipsAddUpTime.htm
    Thanks a lot,
    Paul
    Edited by: Paul Doe on Dec 12, 2009 5:41 PM
    Some sample data:
    EMPLOYEE     WORK HOURS
    =========     =================
    JOHN DOE      1900-01-01 01:00:05
    JOHN DOE      1900-01-01 00:20:00
    JOHN DOE      1900-01-01 01:30:15
    =========     =================
    HOURS WORKED: 02:50:20
    Edited by: Paul Doe on Dec 12, 2009 5:42 PM
    Edited by: Paul Doe on Dec 12, 2009 5:45 PM

    Guess what, by further testing the code on the website mentioned above I got it working.
    Pus, I needed to change the grouping on the code, so I had to come up with a way to update the formulas based on the groupping field.
    Considering "call_date" is the field that you are groupping by on the designer use the following code to update the formula:
    CrystalReportObj = new ReportDocument();
    CrystalReportObj.Load("C:\\reportfile.rpt");
    FieldDefinition FieldDef;
    //Get formula
    FormulaFieldDefinition FormulaDef1;
    FormulaDef1 = CrystalReportObj.DataDefinition.FormulaFields["SubHours"];
    //Get formula
    FormulaFieldDefinition FormulaDef2;
    FormulaDef2 = CrystalReportObj.DataDefinition.FormulaFields["subMinSec"];
    //Update the formula to work with the new grouping field,
    //this must be called first else will throw an exception
    FormulaDef1.Text = FormulaDef1.Text.Replace("call_date", "call_extension");
    FormulaDef2.Text = FormulaDef2.Text.Replace("call_date", "call_extension");
    //Get the new field we are grouping by
    FieldDef = CrystalReportObj.Database.Tables[0].Fields["call_extension"];
    //Replace current grouping field with the new one,
    //considering there only one group in the report, index 0
    CrystalReportObj.DataDefinition.Groups[0].ConditionField = FieldDef;
    Have fun.
    Edited by: Paul Doe on Dec 12, 2009 8:43 PM
    Edited by: Paul Doe on Dec 12, 2009 8:53 PM

  • How to generate current time in the format yyyy-mm-ddThh:mm:ssZ in the xslt

    Hello,
    i am tring to generate current time in the format yyyy-mm-ddThh:mm:ssZ in my xlst file.
    the following info are necessary,
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
    version="1.0">
    <xsl:attribute name="generationDate"><xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy-mm-dd hh:mm:ss'), java:java.util.Date.new())"/></xsl:attribute>
    but java SimpleDateFormat doesnt support yyyy-mm-ddThh:mm:ssZ.
    thanks in advance.

    Hi wwuest,
    I use the following code to generate such a date format :
              try {
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   Date date = sdf.parse(strDate);
                   sdf.applyPattern("yyyy-MM-dd'T'hh:mm:ss");
                   strDate = sdf.format(date);
              } // catching the parse exceptionMaybe you could try this method and see if it pass through xsl with :
    new SimpleDateFormat("yyyy-MM-dd").applyPattern("yyyy-MM-dd'T'hh:mm:ss'Z'")Bye

  • How can I change the numeric format of the cursor coordinates display in LV 8.2

    Since LV 8.0 or so the cursor display window of a graph indicator seems to be a tree control. I couldn't find where to change the numeric format of the numbers displayed in that control. What did I miss?

    lecroy wrote:
    Maybe I'm not clear on what your looking for but I just use a property node and route the raw cursor data out to what ever function I want to run on it, then display it in a seperate field.  The nice thing with the property node is you can have multiple graphs linked together by one set of cursors all with different readouts. 
    Yes, of course that's an option and I guess I'll have to do it that way.
    The point is that I converted a pre-LV-8.x program to LV 8.5. In the program I had used the coordinates display field in the cursor legend to display the position, just the was the cursor legend is supposed to be used, IMO. And in pre-LV-8.x days it was possible to customize the numeric format property of the cursor legend (either directly or by property nodes). It seems that with LV 8.x NI chose to use a treeview control for the cursor legend. With that 'improvement' the numeric formatting flexibility was lost since now the conversion to the string content in the cursor legend's treeview is happening somewhere 'under the hood'.
    <rant> Why do they (NI) always try to 'improve' things (where nothing needs be improved) and sacrifice functionality on the way....? </rant>

  • How to find out the top 10 data loads based on time duration?.

    Hi,
    We are working on performance tuning. so we want to find out the top 10 loads which had run long time in date wise.
    We need the load start time and end time of the load process, Infosource and datatarget name.
    There are nearly 1000 loads, So it is very difficult to collect the load's timings in RSMO.
    Is there any another alternative to collect the top 10 loads based on time duration in date wise?
    Thanks & Regards,
    Raju

    Hi Gangaraju,
    You can install BI Statistics for getting these type of data.
    Or you check in RSDDSTAT or RSMDATASTATE_EXT or  table for the Load process time.
    Or goto t-code ST13 to get detailed analysis of a Process chain for a given period.
    Hope this helps.
    Regards,
    Ravi Kanth

  • How to store numeric format data in a database

    In order to properly format a report generated from data stored in a database using a TestStand schema,
    I would like to add formating information for numeric values to the database.
    My intent was to store the numeric format string data in a separate column in the MEAS_NUMERICLIMIT table in the database.
    By using this format string I can then format the numeric values in my report.
    I have successfully retrieved the numeric format string by calling the 'NI TestStand API 3.0', using the ActiveX/COM adapter.
    In the 'PropertyObject' class there is an action called 'Get Property'.
    This action can retrive the 'NumericFormat' property for a given object reference.
    The problem is that I don´t know HOW to do this in the dat
    abase logging schema.
    Can I use this method in the API to retrive and store the numeric format string in the database??
    Or is there any other way of achieving this functionality?
    All ideas for solutions are appreciated.
    Thanks in advance!

    Yes you can. I think it would be helpful if you explain in more detail what you are trying to do.
    >>>> Basically I am trying to reproduce the data sheet created by test stand by using the data in the database.
    Are you using an NI default schema or have you already customized it?
    >>>> I already have a custom schema that I created many years ago, But if I have to start with a 'newer' default schema it wouldn't be to much of a problem to incorporate my changes into it. (I had added Model number and Comment to UUT result table and provided support for custom step types, the custom step types are based on the default NumericLimit step type )
    If default, what about the schema is insufficient for what you want to do?
    >>>> In order to generate a datasheet from the data in the database that replicates the datasheet produced by teststand, I need the Formatted values for the test results and the test limits. So I'm thinking it would be easier for me to query the database for the formatted numbers (as strings) instead of having to query the database for the 'numeric value' and the 'format string' and then creating the string for my datasheet.
    Is the data and limits that you are trying to log custom properties or or is this for the NI numeric or multi-numeric step type?
    >>>> No using custom properties, just dealing with 'NumericLimit' step types
    I had looked at how the 'SequentialModel.Seq' calls the modelsupport2.dll to  to produce the data sheet entries.
         ProcessModelPostResultListEntry >
         Process Step Result >
         Get Step Result Body (Sequence) >
         Add Flagged Values >
         modelsupport2.dll >
         GetFlaggedValuesForReport_Html
    But, alas, I don't understanding the whole traversing concept.

  • Numeric format based on data in another field

    I am trying to set up a form where the numeric format of one field is based on units of measure in another field. The fields are: units1 and iq1. What I want to do is have the iq1 field format for percent with two decimal places when units1 is  LS or ls or L.S. or l.s. otherwise the field should be formatted for a number with the format nnn,nnn,nnn.nn. Any help for this newbie is appreciated.

    I think this is what you are looking for:
    Make sure that you select "Commit selected value immediately" in the options tab of the drop down menu.
    //Place this script in the custom validation script of the drop down menu
    //Create a text field caleld Text2
    var MySelection = event.value;
    switch (MySelection) {
    case "Accountability":
        this.getField("Text2").value = "Accepts personal responsibility for the quality and timeliness of work. Can be relied upon to achieve results with little need for supervision. ";   
    break;
      case "Compliance":
        this.getField("Text2").value = "Complies with policies, procedures, workflows and instructions.";
        break;
    I hope this helps.

Maybe you are looking for

  • Connecting HDD to Airport Extreme causes orange death light...

    I am in a small office network with mix of pc and mac (7 pc's, 1 iMac, 1 wireless iMac, and 3 wireless macbook pro's). Internet connection comes into building directly to airport. Airport then feeds a couple of systems directly and a Dlink 24port eth

  • What is KPI in SAP BI and what tool do you use to design it?

    Hi, I am a currently in project that demands the design of a KPI in SAP BI. I need some help in understanding the concept of KPI and how you design it (Using Which TOOLS? For example BEx analyzer). And I also want to know if KPI is a form of reportin

  • Need to find invalid coverage period

    Hi Gurus I have the following data: Creation of Table DROP TABLE cal_rules; DROP TABLE cal_rules_dtl; CREATE TABLE cal_rules rule_id NUMBER(10), effective_date DATE, termination_date DATE); CREATE TABLE cal_rules_dtl rule_id NUMBER(10), as_of_date DA

  • COPA - Free items are included in sales qty

    Items used for packaging purpose are listed in the billing document as free goods with different item category.  But the quantity is counted as sales quantity.  Is there is any setting that can solve the issue? Thanks!

  • Home nw w/ two distinct wireless signals

    I've got a AEBS (gigabit) and and WRT54G. I've got the WRT54G set up as a router (not gateway) device, attached to the AEBS, broadcasting a G-only signal (unique SSID to reflect this). I'm doing this so I can set up the AEBS for N-Only access (again,