From Time column in Excel to Java Date ?

Hi there!
After I have read range data from Excel to a Java Object[][]
array/table, one of my excel time columns becomes "floats"
numbers when I try to access them in Java, like this:
from 15:00:00 in Excel to 0.625 in my Java program
How can I avoid this OR transform/parse this 0.625 number
back again to time/Date 15:00:00 inside Java ? hmmm
Is there any setup of jCom that can controll this somehow ?
I have been able to transform:
from 11.15.01 in Excel, becomes "Thu Nov 15 00:00:00 CET 2001"
with the jCom bridge ...
When I have this "string" on this format, it's easy
to get a Java Date of this with SimpleDateFormat.
... but not with this time of mine :-)
Any clues where to look or a solution for this ?
-- Thank you !
-- Erlend

Excel stores times as decimal fractions (representing portions of a day)
There is no Time data type in VB so is probably represented by a Single
object.
This object is then converting to a java.lang.float on the Java side.
0.625 can be parsed by multiplying by (24*60*60) to get the number
of seconds after midnight.
A list of supported COM data types and their java equivalents
can be found in chapter 7 of the jCOMReference pdf file.
damon
"Erlend Bjorge" <[email protected]> wrote in message
news:3be2983e$[email protected]..
>
Hi there!
After I have read range data from Excel to a Java Object[][]
array/table, one of my excel time columns becomes "floats"
numbers when I try to access them in Java, like this:
from 15:00:00 in Excel to 0.625 in my Java program
How can I avoid this OR transform/parse this 0.625 number
back again to time/Date 15:00:00 inside Java ? hmmm
Is there any setup of jCom that can controll this somehow ?
I have been able to transform:
from 11.15.01 in Excel, becomes "Thu Nov 15 00:00:00 CET 2001"
with the jCom bridge ...
When I have this "string" on this format, it's easy
to get a Java Date of this with SimpleDateFormat.
... but not with this time of mine :-)
Any clues where to look or a solution for this ?
-- Thank you !
-- Erlend

Similar Messages

  • Getting the Headings and Time Column on Excel Spreadsheet

    Hi,
    I am reading a 2-D array of data on an excel spreadsheet. Currently I only have the readings on the spreadsheet. Ideally I would like to have a time column in the spreadsheet as well and also the ability to add column name to each column of data read in the spreadsheet. Is there any way through which I can do this? I have added an image of the wiring I am doing for my interface below.
    Thanks,
    Rohit

    Attached is how I save data and time stamp to a csv file.
         The header information is on the far left, before the loop.
    It's probably considered an  "Old School" way of doing things.
    Let me know if this helps.
    Bill
    Attachments:
    Temperature logger LV7 SCC 6-26-07.vi ‏511 KB

  • Export Time column to Excel

    I know SSRS doesn't really have a time data type outside of the datetime type, but I'm trying to have a time column which exports to excel as a time data type.  I've tried a few different ways, but the only way that seems to convert over is having the
    textbox expression =TimeValue("00:30:00").  The problem is this creates a datetime and displays the date portion.  I've tried using custom formats of hh:mm:ss, and those look fine while running the report, but excel sees it as a negative datetime
    which produces a malformed value.
    To clarify by example, I have a time 00:30:00 which exists in a textbox on the report that I want to export to excel as 00:30:00 but as a data type of Time so that if someone were to write excel formulas based off of those cells, it would be able to perform
    time-based arithmetic on them.
    Any ideas?

    Bin Long,
    I'm wanting to preserve the datatype such that Excel recognizes the column as a Time type.  Formatting the column will make it look right, but it will be recognized as a string in Excel.
    Ravi,
    This functionality also does not preserve the actual datatype.  It is really just a wrapper for the format function.  What I need is for the data itself in the column to be recognized as a Time datatype in Excel and not just be formatted
    like one.
    I'm getting the feeling this just isn't possible in SSRS which is disappointing.  I've tried writing custom code for it and creating custom types but neither of these work either.  I have also looked into converting the column into a SQL time type
    (newly available in 2008 R2), but that also isn't giving me the desired result.  I feel that SSRS is really lacking in the available datatypes arena.

  • Will a system restore from Time Machine erase any of the data that is currently on the Mac and not in the Time Machine?

    We had a lot of data on our Mac (i.e. photos, iTunes libraries etc) which we backed up via Time Machine. The hard disk corrupted so we had to get it wiped. When we got it back, my parents started using the mac as per usual but they didn't do a full System Restore from Time Machine. So, if I do a full restore now, will it erase any of the new photos, musc etc that is currently on the mac?

    The Time Machine restore will only restore what is on Time Machine.  Making a clone is probably a better means of ensuring whatever data you want recovered gets recovered together with Time Machine.
    Generally speaking, applications that are newer than the operating system from Apple that are included with the operating system are not supported.  So in your data recovery process from your clone, you'll have to be careful what data you choose to copy back.

  • Export more than 253 characters from ALV column to excel

    Hi
    I have one problem. In internal table, i have one column which is having 2500 characters. I have to export this column in excel but i am able to export only 253 characters max from alv standard export.  How can i export complete column to excel from ALV?
    Regards
    Manish

    Create a new pf status and add a excel button in the menu. While creating new menu, use the standard SAP menu and just change the excel button. SY-UCOMM would &EXCEL. Use GUI_DOWNLOAD to download the excel or the file. It is not achievable using the standard SAP download option.

  • How to read the data from a column that is in clob data type (but XMLdata)

    Hi ,
    I have a table XYZ which has a column RESPONSE_XML in clob datatype format.we can convert it to XMLTYPE(RESPONSE_XML) to read the data in XML format.
    Now this is the DynamicXML schema file. Here I want to see all the COMMONNAME, ResourceDescribedby_VALUE into column_A, ResourceDescribedby_ResourceSpecCharacteristic_Name tags into column_B
    How can I do that .. any suggestions please ..
    Here is a sample XML:
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    _- <soap:Body>
    - <SearchResourceResponse xmlns="http://www.google.com/google.xsd">
    - <MessageElements xmlns:tns="http://www.www.google.com/google.xsd" xmlns="">
    <MessageStatus>SUCCESS</MessageStatus>
    - <MessageAddressing>
    <from>gmail</from>
    <to>Gmail SOAPTester</to>
    <messageId>1234</messageId>
    <action>SearchResource</action>
    <transactionId>OR</transactionId>
    <ServiceName>SearchResource</ServiceName>
    <ServiceVersion>1.1</ServiceVersion>
    </MessageAddressing>
    </MessageElements>
    -<SearchResponseDetails xmlns:tns="http://www.www.google.com/google.xsd" xmlns="">
    - <SubNetwork>
    - <Pipe xsi:type="icl:Trail" xmlns:icl="http://www.www.google.com/google.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <CommonName>318-223-4675</CommonName>
    <objectID>91535716980514105329</objectID>
    <SourceSystem>MARS</SourceSystem>
    - *<ResourceDescribedBy> <value>RDSSLA</value>* *<ResourceSpecCharacteristic> <name>*CentralOfficeCode</name>   </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceRelationship>
    - <Resource xsi:type="icl:Trail">
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>AssignLocationExternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>PairVerticalExternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>PairVerticalInternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>+</value> - <ResourceSpecCharacteristic> <name>PairVerticalSign</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>RDSSLA</value> - <ResourceSpecCharacteristic> <name>CentralOfficeCode</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>B</value>- <ResourceSpecCharacteristic> <name>EntityType</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceType>FeederCircuit</ResourceType>
    - <LogicalPhysicalResource>
    - <PhysicalResource xsi:type="icl:PhysicalConnector">
    <usageState>S</usageState>
    - <ResourceDescribedBy> <value>25.392</value> - <ResourceSpecCharacteristic> <name>CableLength</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    </PhysicalResource>
    </LogicalPhysicalResource>
    - <TerminationPoint xsi:type="icl:TrailTerminationPoint">
    <CommonName>1000/34A</CommonName>
    - </Resource>
    </ResourceRelationship>
    <lrStatus>W</lrStatus>
    </Pipe>
    </SubNetwork>
    </SearchResponseDetails>

    you don't appear to have posted valid XML, so I can't reproduce using your example, but you will need to look at something like this:
    select xtab.common_name
      from your_table yt
          ,xmltable('/SearchResourceResponse'
              passing xmltype(yt.response_xml)
              columns
                  common_name varchar2(20) path 'SearchResponseDetails/CommonName'
          ) xtab
    ;

  • Returning a result from multiple columns based on the last date that the column has a value.

    I have this table named (pmtable)
    ctrlno        jobid           docdate       work1      work2       work3
    1                7              2/12/2014     20 hrs       
    10 hrs
    2                7             2/22/2014      35 hrs                       
    15 hrs
    3               7              2/28/2014                                       
    12 hrs
    4               8              1/17/2014      15 hrs        
    13hrs
    I want the result to be like this
    jobid  work1    work2    work3
    7        35hrs    10 hrs     12 hrs
    Is this possible?

    Hi serenace,
    To achieve your requirement, you can reference the below.
    DECLARE @Tbl TABLE(ctrlno INT,jobid INT,docdate DATE,work1 INT,work2 INT,work3 INT);
    INSERT INTO @Tbl VALUES(1,7,'2/12/2014',20,10,NULL);
    INSERT INTO @Tbl VALUES(2,7,'2/22/2014',35,NULL,15);
    INSERT INTO @Tbl VALUES(3,7,'2/28/2014',NULL,NULL,12);
    INSERT INTO @Tbl VALUES(4,8,'1/17/2014',15,13,23);
    INSERT INTO @Tbl VALUES(4,8,'2/17/2014',15,NULL,NULL);
    INSERT INTO @Tbl VALUES(4,8,'3/17/2014',NULL,16,NULL);
    ;WITH cte AS(
    SELECT jobid,docdate,attr,value FROM
    @Tbl
    UNPIVOT
    (value FOR attr IN(work1,work2,work3)) AS UT
    cte2 AS(
    SELECT jobid,attr,value , ROW_NUMBER() OVER(PARTITION BY jobid,attr ORDER BY docdate DESC) AS rn
    from cte
    SELECT jobid,ISNULL([work1],0) [work1],ISNULL([work2],0) [work2],ISNULL([work3],0) [work3] FROM
    cte2
    PIVOT
    (SUM(value) FOR attr IN([work1],[work2],[work3])) AS PT
    WHERE rn=1
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Trying to recover excel 2011 file from time machine,  all excel file edited after Lion install come back as corrupted.

    file that were not edited since Lion install recover fine.

    file that were not edited since Lion install recover fine.

  • How do i label columns in excel

    I need to know what code do i use in labview to label the columns in excel when the data is opened up in excel. Thank You
    Solved!
    Go to Solution.
    Attachments:
    Wii Balance Board-16.vi ‏1358 KB

    This is what it would look like:
    Ignore the fact that I compressed the code in the loop. The important part is that you write the first row once before the loop and the rest of the data inside the loop (with the append input as T).
    In general, this is very important to understand on your own if you expect to do anything in LV. I would strongly suggest you follow those tutorials and try learning from other places as well.
    Try to take over the world!

  • Passing value from Report Column to Javascript

    Dear Apex wizards,
    I am a bit stuck right now with implementing a modal pop-up/iframe/javascript and this forum is my last hope to fix this issue.
    Anyway, will try to explain what I am trying to accomplish.
    What I need is: I want to have an SQL report, as a very first column I want to have an "ID" numbers from my table and I want this column to have a "Column Link" set in "Column Attributes" proper ties. The trick is, that when I click on the column link (when I run my report on Apex page) I need a JQuery modal window to pop-up where in IFrame will be another page and this page will use an "ID" from my column link URL to display data. So, basically I want to pass an "ID" value from my parent page to my child page which is displayed in iFrame of modal window.
    And here is what I have:
    1. I do have an SQL report:
    select SUBNET_ID,
           long2ip(NETWORK_ADDRESS),
           long2ip(SUBNET_MASK),
           long2ip(END_HOST),
           long2ip(START_HOST),
           MAX_HOSTS,
           long2ip(BROADCAST_IP),
           NETWORK_CLASS,
           NETWORK_SIZE,
           HOST_SIZE
    from   YC_CM_IP_SUBNETS 2. Then, in "Column Attributes" for "SUBNET_ID" a have set a "Column Link" to URL as : javascript:ViewNetworkDetails(#SUBNET_ID#); 3. Now, when I run my page and point my mice on any item in my "SUBNET_ID" column I can see that it is getting a "SUBNET_ID" number from my table and it shows it in the buttom of the browser as :javascript:ViewNetworkDetails(1);, or (2) or whatever "SUBNET_ID" is. So, that is good.
    4. And here I am getting confused, basically I have to pass a value of javascript:ViewNetworkDetails(#SUBNET_ID#);, which seems to work as it gives me correct numbers from my table, to my "ViewNetworkDetails" JavaScript function, so it can paste this value into "f?p=........." iFrame URL. Below is my Jquery Modal form script and Javascript to redirect me to my popup page (the script is in HTML Header):
    <script type="text/javascript">
    function ViewNetworkDetails(){
    var apexSession = $v('pInstance');
    var apexAppId = $v('pFlowId');
    var subnetIDNumber = document.getElementById(#SUBNET_ID#);
    $(function(){
    vRuleBox = '<div id="ViewNetworkDetailsBox" title="View Subnet Details">
    <iframe src="f?p='+apexAppId+':103:'+apexSession+'::NO:103:P103_SUBNET_ID:'+subnetIDNumber+'
    "width="875" height="500" title="View Subnet Details" frameborder="no"></iframe></div>'
    $(document.body).append(vRuleBox);
    $("#ViewNetworkDetailsBox").dialog({
                            buttons:{"Cancel":function(){$(this).dialog("close");}},
                            stack: true,
    modal: true,                            
                            width: 950,                    
    resizable: true,
    autoResize: true,
    draggable: true,
    close : function(){$("#ViewNetworkDetailsBox").remove();
                            location.reload(true); }
    </script> P.S. My assumption is, that there is a problem with this part of my scriptvar subnetIDNumber = document.getElementById(#SUBNET_ID#); where I cannot get my "SUBNET_ID" value from javascript:ViewNetworkDetails(#SUBNET_ID#); into "subnetIDNumber" variable and that is why I cannot pass it to my iFrame URL.
    P.S. P.S. the child page 103 has a "Automated Row Fetch", so it is not a problem. In addition, I did a simple test, where I had a page item "P102_Value" with some value and in my script I had instead var subnetIDNumber = document.getElementById(#SUBNET_ID#); this var subnetIDNumber = $v('P102_Value'); and it worked perfectly fine....but cannot make it working against SQL Select statement :-(
    HEEEEEEEEEEEEEELLLLLPPPP.
    Thanks

    Change your column link to send the subnet_id column's value to the function call (you mentioned it, but I m not sure if you actually did)
    javascript:ViewNetworkDetails(#SUBNET_ID#);<u>You are passing the parameter value to the function, but not defined any parameters in the function definition</u>(this is possible in JS, any extra parameters is ignored)
    So, modify the function to accept the subnet ID parameter(I am actually surprised how you missed this) and assign that parameter to variable.
    <script type="text/javascript">
    function ViewNetworkDetails(pSubnetId){
    var apexSession = $v('pInstance');
    var apexAppId = $v('pFlowId');
    var subnetIDNumber = pSubnetId;
    //rest of the code would be the same

  • Restoring a deleted column in Excel from a SharePoint Data Connection view

    I used the "Export to Spreadsheet" option for a SharePoint document library to create my working report.  I created a special view for this as I did not want all of the columns in my export.  I build my report on a seperate tab in Excel
    around this exported data and it has been working great.  I recently added a new column to the view on SharePoint but it does not show up when I refresh my data.  I tried manually adding the column, evening ensuring it was in the same orderl;
    still no luck.  The Connection file does not exist so I cannot edit the owssvr.iqy.  All I have is the connection string and command text.  I created a new workbook to see if the command string changed because of the new column but it did not. 
    I don't want to rebuild my report from scratch just because I added a new column, but it appears that may be the only option I have unless someone can answer my question.
    Question: How can I get a new column from a view added to an existing data connection query?

    Hi,
    First, make sure you have added the new column into the view as well as the list.
    Second, try to use "MSQuery" feature in Excel to check the issue.
    For more information about MSQuery, please refer to the following link:
    http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
    Jaynet Zhang
    TechNet Community Support

  • Is there a way to import data from excel -when one of the columns in excel is hyperlink column?

     Is there a way to import data from excel  - so if a column is hyperlink - the whole data will move to the list (text + link of the hyperlink column)?
    keren tsur

    Hi,
    According to your description, you want to export excel which contains a hyperlink column to SharePoint list.
    Refer to the following steps:
    Open the Excel, insert/create the table. 
    Now click on any cell of table and go to the ‘Design Tools’.
    Click on the Export and then ‘Export table to SharePoint List’.
    You will see a popup where you need to provide the URL of SharePoint site, list name and description.
    Then click on next, On the next screen you will see columns with data types which are going to create in SharePoint list.
    Now click finish and wait until the operation gets finished. You will see that list gets created in SharePoint site with the records.
    Here are two links, you can use as a reference:
    http://sharepointrhapsody.com/2013/03/25/how-to-create-a-connected-excel-file-to-sharepoint-list/
    http://social.technet.microsoft.com/wiki/contents/articles/18705.sharepoint-2013-how-to-export-excel-sheet-to-sharepoint-list.aspx
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How to delete the date and time column from a waveform spreasheet file

    after acquiring a signal through the DAQ i am writing it in a spreadsheet. but for further post processing of the data the date and the time column are unneccessary. is there some way to format the file in labview so that those columns are removed. the DAQmx read  gives as output a 1 d array. so i could not find a way to select only the Y column

    If you are getting a 1D array from the DAQmx Read, then you don't have any date/time information to write and if you are using the Write to Spreadsheet File, there should be no way you can have the date/time information in the file. Whatever you hjave programed to put the date/time into the file, don't do it.
    p.s. You may not think you need timing information but for a lot of post-processing, it is essential to have. If it's in the file, you can always ignore when you read it and if you later find out it's necessary, it will already be there.

  • Type of object from a database date/time column

    Hello everyone,
    I've got a concern regarding the way in which coldfusion is
    treating date/time columns in a database.
    In my opinion when I select a column that is let's say
    timestamp type - the object in a query is CF's date/time object.
    I've checked the query by getMetaData() and it looks like each
    column has its own database type (eq. varchar2, date, etc).
    My concern comes from a fact that I've heard that Coldfusion
    is treating the date-time columns in a database as strings and in
    each case it parses them. So the difference in a locale between a
    database server and a Coldfusion server may result in a wrong
    date/time object.
    Example:
    Locale of database EU: yyyy/mm/dd
    Locale of Coldfusion US: yyyy/dd/mm
    The date like 1st of February 2007 stored in a database would
    look then in Coldfusion like: 2nd of January 2007
    Could someone please confirm which version is valid?

    Johnny852 wrote:
    > In my opinion when I select a column that is let's say
    timestamp type - the
    > object in a query is CF's date/time object. I've checked
    the query by
    > getMetaData() and it looks like each column has its own
    database type (eq.
    > varchar2, date, etc).
    if you already know cf is returning a datetime from a
    datetime in the db, what's
    the question?
    > My concern comes from a fact that I've heard that
    Coldfusion is treating the
    "fact"? unless the datetime is stored as a string, that's not
    a "fact".
    > Example:
    > Locale of database EU: yyyy/mm/dd
    > Locale of Coldfusion US: yyyy/dd/mm
    btw neither of your example "locales" are in fact locales.
    > The date like 1st of February 2007 stored in a database
    would look then in
    > Coldfusion like: 2nd of January 2007
    if you pass a numeric string representation (2/1/2007 for
    instance) of a date to
    cf, it will be interpreted via the cf server's "default"
    local (ie en_US,
    month/day/year) unless you use one of the LS functions like
    LSParseDateTime() &
    specifically set the the locale (like setLocale("th_TH")) or
    make the date
    non-ambiguous (2-feb-2007) or build the date yourself from
    user input using
    createDate() or createDateTime(). you just need to convert
    the user's string
    representation to a valid cf datetime object (or i guess
    force to database to
    follow the user's locale date mask).

  • Import data from table,export to excel----URGENT

    Dear all ,
    I have a requirement of importing data from database table and then export those data to excel. that means irrespective of column number and row number present in the table,i have to export that table's records to excel. In my from i have text field, by which user will enter table name, it will validate whether DB have that table....if that table present in DB , i have to export it's data to excel..............
    any kind of help and suggestion is welcome

    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>Announcement: Forums Etiquette / Reward Points
    </ul>
    Please provide us with your Forms version, Java version and Client OS version. This information is needed in order to offer you potential solutions. Performing this task in Forms 6i (Client/Server) is completly different than in Forms 9i/10g/11g.
    With respects to your "Urgent!" request. You have to understand that forum contributers are all volunteers - this is not our full-time job. If your issue is truely urgent, it is always best to open a Service Request (SR) with Oracle Support than to rely on the forum for an urgent reply! ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for