string to datetime interesting problem


I am solve some problem with Labview and I find very interesting bug.

It's just time conversation of string to the datetime format.

In the image below, I did 24 times this conversation to show, the result for each hour of the day.

Looks like labview have some problems with times of conversation in format 2:XX: XX (I mean, when the number 2 is the first).

Someone has an idea how to fix this bug?


The solution is:

1 convert the variant to a string

2 channel converted variant with format string %^<%d.%m.%Y % H: % m: %s > T, where ^ is important

3. Use the Format Date/time with set to True UTC

Tags: NI Software

Similar Questions

  • interesting problem with sending e-mail

    Hello world
    I faced a very interesting problem. In the code below, I want to send a variable (w_data) with the html, but the recipient do not e-mail, but when I remove the part (w_data) "BOLD" and write a string like "Gauthier", the recipient takes this e-mail. What is the problem, why I can't send a varchar2?

    v_from VARCHAR2 (80): = "[email protected]";
    v_recipient VARCHAR2 (80): = "[email protected]";
    v_subject VARCHAR2 (80): = "test subject";
    v_mail_host VARCHAR2 (30): = "";
    v_mail_conn UTL_SMTP.connection;
    CRLF VARCHAR2 (2): = CHR (13) | CHR (10);
    CURSOR cur_
    Select disconnect_cause in the rawticket_voip;
    w_data VARCHAR2 (31000);

    v_mail_conn: = UTL_SMTP.open_connection (v_mail_host, 25);
    UTL_SMTP. HELO (v_mail_conn, v_mail_host);
    UTL_SMTP.mail (v_mail_conn, v_from);
    UTL_SMTP. RCPT (v_mail_conn, v_recipient);

    w_data: = ' < html >
    < table border = "1" >
    < tr bgcolor = 'Light Blue' > ';
    W_DATA: = W_DATA | "< td >" | C.DISCONNECT_CAUSE | "< table >";
    w_data: = w_data | ' < /tr >
    < /table >
    < / html > ';
    ' Date: '
    || To_char (SYSDATE, ' Dy, hh24:mi:ss DD month YYYY ")
    || CRLF
    || "To:
    || v_from
    || CRLF
    || "Subject:"
    || v_subject
    || CRLF
    || « À : »
    || v_recipient
    || CRLF
    || "MIME-Version: 1.0 '"
    || CRLF
    || ' Content-Type: text/html; "charset ="us-ascii"
    || CRLF
    || w_data
    || CRLF
    UTL_SMTP. Quit (v_mail_conn);
    WHEN UTL_SMTP.transient_error OR UTL_SMTP.permanent_error
    raise_application_error (-20000, "cannot send an email: ' |") SQLERRM);

    Suggest that rather try next approach instead - the start_data() and close_data() calls.

    SQL> declare
      2          type TStrings is table of varchar2(1000);
      4          smtpSender      varchar2(100)   := '[email protected];
      5          smtpRecipient   varchar2(100)   := '[email protected];
      6          mailSubject     varchar2(100)   := 'Sample Mail';
      7          smtpConn         UTL_SMTP.connection;
      9          cursor cur is
     10                  select
     11                          ''||object_type||''||
     12                          object_id||''||object_name||
     13                          ''
     14                  from    user_objects
     15                  order by
     16                          object_id;
     18          mailBody        TStrings;
     20  BEGIN
     21          smtpConn := UTL_SMTP.open_connection( '', 25);
     23          UTL_SMTP.helo( smtpConn, '' ); -- // this needs to be your Oracle server hostname or IP!
     24          UTL_SMTP.mail( smtpConn, smtpSender );
     25          UTL_SMTP.rcpt( smtpConn, smtpRecipient );
     27          -- can be done using an implicit cursor instead
     28          open cur;
     29          fetch cur bulk collect into mailBody;
     30          close cur;
     32          -- start sending mail body using the data command
     33          UTL_SMTP.open_data( smtpConn );
     35          -- write header
     36          UTL_SMTP.write_data( smtpConn, 'MIME-Version: 1.0'||utl_tcp.CRLF );
     37          UTL_SMTP.write_data( smtpConn, 'Content-Type: text/html'||utl_tcp.CRLF );
     38          UTL_SMTP.write_data( smtpConn, 'From: '||smtpSender||utl_tcp.CRLF );
     39          UTL_SMTP.write_data( smtpConn, 'To: '||smtpRecipient||utl_tcp.CRLF );
     40          UTL_SMTP.write_data( smtpConn, 'Subject: '||mailSubject||utl_tcp.CRLF );
     42          -- empty line between header and rest of mail body
     43          UTL_SMTP.write_data( smtpConn, utl_tcp.CRLF );
     45          -- now write the HTML
     46          UTL_SMTP.write_data( smtpConn, ''||utl_tcp.CRLF );
     47          for i in 1..mailBody.Count
     48          loop
     49                  UTL_SMTP.write_data( smtpConn, mailBody(i)||utl_tcp.CRLF );
     50          end loop;
     51          UTL_SMTP.write_data( smtpConn, '
    '||utl_tcp.CRLF ); 52 53 -- close the data command 54 UTL_SMTP.close_data( smtpConn ); 55 56 UTL_SMTP.quit( smtpConn ); 57 end; 58 / PL/SQL procedure successfully completed. SQL>
  • Issue of conversion from string to DateTime to subtract the duration of 1 day in the XSLT file


    I need to subtract the duration 1 day after the date of entry which is in the format "yyyy-mm - ddT00:00:00"(data type = String)
    I tried to use the available function: subtract-dayTimeDuration-from - dateTime () but this function expects the entry in the datetime data type and so on use of this I get Null as the result of the transformation.

    I used to convert the input string, dateTime() but it doesn't seem to work because I get the error "Invalid Xpath expression (null).

    Please help identify any other way I can convert the string to dateTime format and then subtract the duration. Or another way to subtract the length of the day 1 of the string itself.

    Thanks for the help!


    It should work with the date in the format that you have... Look at the code, there may be a typing error... In addition, in BPEL, you must use the xp20 functions...

    Take a look at this...

    I hope this helps...

    See you soon,.

  • Very interesting problem, urgent need for resolution

    Hi guys,.

    I have weird and interesting problem I repair emergency. Appreciate any help you guys can provide.

    I have a query that is running in all our database but Prod. Our UAT is updated every fortnight by Prod, so I'm sure it's not a data problem. I even tried for very small dataset making sure to select the same data in UAT and Prod.


    ORA-00932: inconsistent data types: expected NUMBER obtained -

    select level ,--works if we reomve this
     xmlelement("L1", XMLATTRIBUTES(resource_name as "L1" ,resource_id as "p_resource_id",resource_manager_id as "p_rm_id",FTE, project_hrs ,
                 misc_hrs , total_hrs, avg_tot_hrs, Perc_utilization))
          from (  SELECT   resource_id,
               trim(to_char(round(SUM (FTE),1), '999,999,999,999.9')) FTE,
               trim(to_char(round(SUM (project_hrs),1), '999,999,999,999.9')) project_hrs,
               trim(to_char(round(SUM (misc_hrs),1), '999,999,999,999.9')) misc_hrs,
               trim(to_char(round(SUM (total_hrs),1), '999,999,999,999.9')) total_hrs,
               trim(to_char(round(SUM (total_hrs)/decode(SUM (FTE),0,1,SUM (FTE)),1), '999,999,999,999.9')) avg_tot_hrs,
               trim(to_char(ROUND (SUM (project_hrs) * 100 / decode(SUM (expected_project_hrs),0,1,SUM (expected_project_hrs)), 1), '999,999,999,999.9'))
        FROM   (    SELECT   CONNECT_BY_ROOT resource_name AS resource_name,
                             CONNECT_BY_ROOT resource_id AS resource_id,
                             CONNECT_BY_ROOT resource_manager_id AS resource_manager_id,
                      FROM   (    SELECT   r.username resource_name,
                                    FROM   TIME_UTILILIZ_ORG_SUM_L3M_MV r
                              START WITH   resource_id = 129523
                             CONNECT BY   PRIOR r.resource_id = r.resource_manager_id)                
                CONNECT BY   PRIOR resource_id = resource_manager_id)
    GROUP BY   resource_id, resource_name, resource_manager_id) 
              start with resource_id =129523 connect by prior resource_id=resource_manager_id; --works if we remove this
    If we remove outermost connect, it works so not a problem of xmlelement as well. Any idea?

    Published by: 783830 on July 22, 2010 06:58

    I don't know if this will help, but:

    with my_tab as (select 1 resource_id, 0 resource_manager_id, 1 project_hrs from dual union all
                    select 2 resource_id, 1 resource_manager_id, 1 project_hrs from dual union all
                    select 3 resource_id, 1 resource_manager_id, 1 project_hrs from dual union all
                    select 4 resource_id, 2 resource_manager_id, 1 project_hrs from dual union all
                    select 5 resource_id, 2 resource_manager_id, 1 project_hrs from dual union all
                    select 6 resource_id, 0 resource_manager_id, 2 project_hrs from dual union all
                    select 7 resource_id, 6 resource_manager_id, 2 project_hrs from dual union all
                    select 8 resource_id, 7 resource_manager_id, 2 project_hrs from dual),
    --- end of mimicking some data
        results as (select resource_id,
                           prior resource_id prev_resource_id,
                           level lvl,
                           sum(project_hrs) over (partition by connect_by_root (resource_id)) tot_project_hrs
                    from   my_tab
                    connect by prior resource_id = resource_manager_id),
       results2 as (select resource_id,
                           connect_by_root resource_id top_resource_id,
                           prior resource_id prev_resource_id,
                           level lvl
                    from   my_tab
                    connect by prior resource_id = resource_manager_id
                    start with resource_manager_id = 0)
    select r1.resource_id,
    from   results r1,
           results2 r2
    where  r1.resource_id = r2.resource_id
    and    r1.lvl = 1
    order by resource_id;
    ----------- ----------- --------------- --------------- ---------------- ----------
              1           1               5               1                           1
              2           1               3               1                1          2
              3           1               1               1                1          2
              4           1               1               1                2          3
              5           1               1               1                2          3
              6           2               6               6                           1
              7           2               4               6                6          2
              8           2               2               6                7          3
  • Manipulating strings using SQL - a interesting problem


    I came across this problem, but have not been able to find a solution yet.
    If an input string, the output must be a string with all the double quotes ("") replaced by two quotation marks (""). In addition, if a double quotation mark is preceded by a number (s) then the output must be a string where the number is enclosed in quotation marks.

    Should be a SQL solution only (no calls to functions allowed). Preferably without using CASE or DECODING.
    What are the different ways to do this?

    1 abc'd is expected to produce abc' "d as output.
    2 ab 'c' d is expected to produce ab "" c"" d as output
    3 abc "d12" is expected to produce abc "" d"12" as output
    4 ab12 "c34" should produce ab '12' c '34' output

    That's what I've done so far, but it does not work for the fourth case above. I know that there must be a more elegant and correct solution.
    SELECT REGEXP_REPLACE(REPLACE('&test_string', '"', '""'),
                          '"' || REGEXP_SUBSTR(REPLACE('&test_string', '"', '""'),
    PS: I'll keep the post updated with my attempts.

    Kind regards


    Would you like to if the entry is
    a '12' 3 "4B".

    a"""12" "3"4B ".

    And that's exactly what you get with my solution (see the last line):

    with mydata as
    Select "abc" test_string of all the double union
    Select "ab"c"d" test_string of all the double union
    Select 'abc 'd12' ' test_string of all the double union
    Select "ab12"c34"" test_string of all the double union
    Select ' a '12' 3 "4 b ' double test_string"
    SELECT REGEXP_REPLACE (REPLACE (test_string, ' "'," "" ""),)
    "([0-9]_{1,})" "", '"\1" ') output
    OF mydata;

    ABC"d «»
    AB "" c"" d
    ABC '"d" 12 ".
    AB c '12' "34".
    a"""12" "3"4B ".

  • How to convert string to datetime in the transformation of the Ombudsman


    I am getting error below when inserting the data in the database using the database.

    Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run reference"insert"operations have to: DBWriteInteractionSpec Execute Failed Exception." insertion failed. The descriptor name: [InsertPayload.XxohInsertStgTable]. Created by Exception [EclipseLink-3001] (Eclipse - 2.3.1.v20111018 persistence Services - r10243): org.eclipse.persistence.exceptions.ConversionException Description of the Exception: object [2015-09-14 15:19:51], class [class java.lang.String], couldn't be converted [class java.sql.Timestamp]. Inner exception: LINK. JCA-11636 couldn't convert Timestamp Exception. Cannot convert a string value in the xml file to a java.sql.Timestamp. Although the databases accept strings representing the timestamps in a variety of formats, the adapter only accepts strings that represent xml ISO dateTime format. The input value must be in the format XS: DateTime to iso 8601, i.e. YYYY-MM - DDTHH:MM:SS.sss - 07:00. Please see the logs

    In the transformation of the mediator, the Source element is a string

    < xs: element name = "CREATED_DATE" type = "xs: String" > < / xs: element >

    Target is of type dateTime

    < xs: element name = "Creation_Date" type = "xs: DateTime" minOccurs = "0" nillable = "true" / >

    To avoid the above error, I used < xsl: value-of select ='xp20:format - dateTime (/CREATED_DATE, "[Y0001]-[M01]-[D01] [H01]: [m01]: [s01]")'/ > in the transformation, but its does not work. The value is blank display after processing.

    Please suggest me how to solve this problem.

    Thank you


    Unfortunately, the format required by the dateTime format is YYYY-MM - DDTHH:MM:SS.sss

    You can use the substring, and on the entry's concat function to create YYYY-MM - DDTHH:MM:SS.sss

    See formatting string to date in BPEL

  • String MySQL DateTime to the number

    Hey... I have a problem with mysql date-time conversation number string.

    ID like converse in digital format date excel.

    My LV conversation for beginning 2013-01-22 10:00 is 3, 44169E + 9 and for

    the same day in a conversation of exel is 41295,4166666667.

    Why is this?

    TNX for your explonations.

    LV: "seconds that have elapsed since 12:00 a.m., Friday, January 1, 1904.

    Excel: "days since January 1, 1900 00:00".

    If you have a scale of 86400 and the shift of 1461 days factor (assuming that 1 year scot)


  • String to number conversion problem

    I have a VI that pulls in data from a device using VISA, and I got it on another computer to work a few weeks back. I had to transfer the VI to a laptop computer to run a few tests, and now I can't make it work. I am unable to put my VI because the laptop on it's is unable to access the network companies, I will do my best to explain it all, I apologize for the inconvenience! My problem is not however with VISA, it's with an exit VISA number conversion chain.

    I have attached a painting drawing of VI to better explain it.

    I use the block series Visa football match in baud rate and all that many good things to the unit and port settings set of device management. Then, a while loop is entered. The loop will run until you press the stop"" button. The next block of visa is the writing block, he asks for a reading of the device. The next block of visa is the first block of reading, he returns playback in the form of "NA-XXX. X' where x are numbers. The next block of visa is the second reading block, this block just echoes back the command sent to the device. Playback of the first visa read block, "NA-XXX. X' is going exponential/fractional chain to digital converter.

    When you perform a run/debug to highlight run, the release of visa reports the correct value, is the value of the device reading - however the string to number converter generates a 0,000, no matter what channel number is. I am at a loss as to what may be wrong because it's the EXACT set up I had to work very well a few weeks ago!

    I'm using Labview 10 on the laptop, the old computer was labview 7. I'm guessing that this is perhaps the rub... I Redid the VI from scratch, although I have not opened the old VI in labview 10.

    Any help would be appreciated. Again, sorry I am unable to attach the VI.

    DARB wrote:

    I have attached a painting drawing of VI to better explain it.

    Would it not have been easier to just post a screenshot? You might also have used the Tool of Capture of Code. (Which reminds me that I need to install it to my previous versions of LabVIEW, as evidenced by the screenshot I took. )

    As to the question: you probably either:

    • employee analysis of chain initially and when you rewrote the VI you used the regular string conversion functions.
    • Wired an offset value in the string to the number function.

  • While the loop and the passage of a string to a Subvi problem

    Hello world

    My problem is this: I have a MainVI and a Subvi, the MainVI is running a while loop in which the Subvi is called and goes to 2 parameters, 1 bool and 1 chain. the problem is, inside the Subvi the chain should be placed in a text box so that the user can see before pressing ok.

    Background of the present: normally "" opens with just the text box and a button cancel, means to scan 10 characters of big entry. It still works fine. If the user selects the DMC model in the MainVI, it should only copy the dummy DMC of the MainVI (the above string) to the show, and Subvi in the text box as well as allow another button 'OK' for the opportunity to control themselves (Advanced) users.

    The Subvi is reloaded on every call because he'd be stuck in the while loop, I had not done that. Not quite sure why, if someone has an answer to that aswell please tell me.

    Many thanks in advance,

    Kind regards


    It might be that the writing of the DMC to "Value DMC" model that happens before the "reset DMC by default".  Try the error off DMC Reint default wiring to the value DMC error to force the order of execution


  • BlackBerry smartphones interesting problem with Outlook synchronization

    I was sync my BB 8310 with my office for over a year without any problems.  For some unknown reason, my calendar in Outlook has all cleared but 19 of my appointment, however, all appointments still exist in my BB.  I am trying to sync w / my Outlook and we tried a lot of new things, including sync on another computer.  Synchronization of 19 appointments even on both machines with anyone else who appear and there are at least 100 with the BB.

    Ive tried a lot of solutions using the Office Manager, but I'm at a loss.  Help, please!

    Thank you all, problem solved.  See below for anyone else having this problem!

  • New to Oracle: DateTime subtraction problems.

    I have a background SQL and I would normally use datediff to get the difference between two times. I'm having a problem getting in oracle. I get a result, but I have no idea what it is! Here's what I'm looking for:

    CAs.q_ld_opn_tm = starttime (format: 23 December 08 08.21.23 AM)
    CAs.q_ld_cls_tm = endtime (format: 23 December 08 09.41.09 AM)

    I need to know how many minutes is between the two. The response I get seems to be in the wrong format, but I don't know how to specify I want minutes.

    (cas.q_ld_cls_tm - cas.q_ld_opn_tm) as CastMin

    My result is:

    Can someone give me an example of syntax?

    Thank you!

    Oracle date arithmetic uses day as a unit. To get used to the minutes:

    (cas.q_ld_cls_tm - cas.q_ld_opn_tm) * 24 * 60


  • Interesting problem

    We have two tables X and Y, which meet on a field, which is of type varchar (30) X and field NUMBER type B (10) in Y. In physics, to join the table, that we were faced with an error that the fields are not compatible to reach, so we updated the B field in the table is of type VARCHAR in the physical layer.

    Now, when we have created reports through ANSWERS BI, the result contains only 1 record for which X.A both Y.B value sizes are 4-digit, other entries that could have been the result of the join have X.A and Y.B over 4-digit values

    Can someone help out us here, as to why the records are not get picked up in the join.

    Thank you

    Use a complex join in physical layer and add TableX.A = TableY.CAST (B as CHAR).

  • Buffer problem and cases of ring series

    Hi all

    I had an interesting problem and have a moment that is difficult to find a solution and thought a pair of fresh eyes can help!  I read data during the series using VISA.  That's going well.  I do this continuously and then adding in a string.  This string, I look for new lines and pull them out of the buffer series chain.  I have then look at the lines to see if they have the appropriate orders and, if so, analyze these commands to control a box structure.

    Now, here's the interesting part.  When I started, I wrote a vi to take in an arbitrary multiline string in and analyze data and sentences, and it works as expected, but when I do it with serial data direct and the ring, the case statement buffer does not.  Also, when I probe the parsed string that will control the case statement, it LOOKS right, but the case statement will not accept it.

    Any thoughts would be greatly appreciated, I'm quite confused as to what is happening here.  I have attached the 2 vi.

    Gurus?  Masters?

    Thank you!

    Jim S,.

    I see a few problems.  As previously validated you should use greater or equal? instead of superior?.  The biggest problem is that you have a string constant value '\n', but the constant itself is not configured for '-' code display mode.

  • DateFormat of DateField causing problem JDE 4.5

    I have a DateField, which uses the DateFormat class to display Date

    SimpleDateFormat myDtTm = new SimpleDateFormat ("YYYY/MM/dd hh: mm aa");

    DateField _dateField = new DateField ("Date:", System.currentTimeMillis (), myDtTm, DateField.DATE_TIME);

    Add (_dateField);

    DateField is added to the main screen


    As in hh hour is represented as 05 (i.e. two-digit)

    I tested the application for 4.5 and Simulator Date time does not appear as hh(i.e. 05 two digits), it is shown as 5 (i.e. h )

    Why does. I'm using _dateField.toString () and obtaining each field as day, month, year, minutes and seconds

    public Calendar convertStringToDate(String dateTime)
    Calendar date = Calendar.getInstance();            date.set(Calendar.DATE,Integer.parseInt(dateTime.substring(0, 2)));
    date.set(Calendar.MONTH, Integer.parseInt(dateTime.substring(3,5))-1);
    date.set(Calendar.YEAR, Integer.parseInt(dateTime.substring(6,10)));
    date.set(Calendar.HOUR, Integer.parseInt(dateTime.substring(11,13)));
    date.set(Calendar.MINUTE, Integer.parseInt(dateTime.substring(14,16)));
    date.set(Calendar.SECOND, 0);
    date.set(Calendar.MILLISECOND, 0);
    String am_pm = dateTime.substring(17);
    //getIntAM_PM will return AM or PM
    int am_pmInt = getIntAM_PM(am_pm);
    return date;

    Here, I get error because the time is only a number IE 5, during recovery, so 5: which is not analyze in Int

    Help, please...

    no need


    will work fine.

  • 3G BT Broadband Mobile (Huawei) problem with IE and Firefox, Satellite L300

    The L300 Satellite running Vista 32 bit.

    I have a connection Broadband BT and with WIFI or ethernet at home I can connect to the internet and go without problem.
    I also have the BT USB Dongle for mobile connection far from home, this is the problem.

    I can connect to the internet through the connection manager BT (the software that is included in the dongle and installed on the Satellite L300) and some dongles light and software see I am connected. Too, it is shown on the icons at the bottom of the computer screen.

    Problem is IE and firefox will open, but neither more, "cannot display this page' or 'Connection timed Out' my access provider Internet (BT) said this isn't a matter of Dongle it's a software issue.

    I know that it is typical of an ISP as much as the two BT lines did not know what to say,
    Funny it is... until last week it worked so I was away from home, I used IE then tried to do the full-screen page and then stopped with "cannot display this page". He has not worked since. I then installed Firefox to check that it was not just IE.

    I disabled my firewall and tried to connect, the same problems.
    My ISP said has the laptop computer connection selected an obscure port that IE of Firefox cannot find?

    If anyone can help?

    I'll go to MS and reinstall IE, I think now if the IE software "crushed" and changed some settings has firefox then tried to use the system corrupted settings?

    I have already downloaded again the BT Manager in BT connection

    Interesting problem.

    You are able to back up your data and run recovery?

    Or maybe just try a system restore to an earlier date.

Maybe you are looking for