I need a formula to convert a date into an integer (for use in Lookout)

I have a DATA logger with the following:
40001 = 4 (2004)
40002 = 2 (February)
40003 = 5 (5th)
40004 = 13 (1:00pm)
40005 = 12 (12 minutes)
Lookout requires a date that it understands (eg. January 1, 1900).
All I need is a basic formula to convert the date and time.
This formula does not need to be specifically written for Lookout. Just a basic formula that I can do on paper or a calculator.
I can integrate that formula into the Lookout software myself.

Hello Smigman,
First of all, I apologize in advance for not giving you "just the formula." And for the lengthy explanation (had to wait till after work hours), which you are very likely aware of already. I am writing this response in much detail so that it may benefit others.. hopefully And so that we understand the underlying principle involved, which will hopefully help us in building the formula the best way that suits us.
As you have figured out, the data and time in Lookout is represented as a real number. This real number's integer portion represents days, and the decimal portion denotes time. The integer portion is basically the number of days since 01/01/1900. And the decimal portion is the number of seconds since midnight.
So, for instance, if you insert the today() Expression in Lookout, you'll get a integer 38022 (which corresponds to today, Feb. 5th, 2004). In other words, today is the 38022nd day since 01/01/1900. Tomorrow, Feb. 6th 2004, will be 38023 and so on.
The decimal part denotes time. A day has 24*60*60 = 86400 seconds, obviously. So, 1/86400 = 1.15741E-5 roughly represents one second. For instance, 38022.00001157 will give 02/05/2004 00:00:01.
Coming to the formula now, for Time, first convert it to total seconds from midnight. E.g., 5:15:07pm would be (17*60*60) + (15*60) + 7 = 62107 seconds total since midnight. To get the Lookout's decimal part, divide this by 86400.
62107/86400 = 0.71883102
Therefore, 38022.71883102 would now give 02/05/2004 17:15:07. Computing Time is relatively easy.
For the Date -- which is more complicated-- you could keep track of the total number of days either from 01/01/1900, or better still, a more recent day, like say 12/31/2003, which corresponds to 37986. To this reference you will keep adding 1 for each additional day to get the number for the current day. Note, you will have to accomodate leap years (Feb. 29th of this year, for instance).
It's very helpful to have the reference day as the last day of the past year. That can be derived by counting the number of days since 01/01/1900 as follows:
104 years * 365 days = 37960;
+ 1 day for each leap year
A leap year is a year divisible by 4 (and 400 if the year ends with two zeros). There were 26 leap years from 1900 till 2003.
So, 37960 + 26 = 37986. 12/31/2003 is thus represented by 37986.
To get the integer for the Current Date we would first find what day of the year it is. Then add it to the reference day. Feb 5th, is the 36th day of the year. Adding this to 37986, gets us 38022.
In your case you will have to come up with the correct day of the year using registers 40002 and 40003. Not sure if this helped or confused you more.
I tried
Khalid

Similar Messages

  • Using disk image to put data into a "stick" for use by PC & Mac

    I am trying to find a quick way to transfer a master file (almost 1gb) onto a series of "sticks" for circulation to colleagues.
    I thought that if I made a disk image that would be OK. It works for Macs but PCs say they cannot find a progamme to open the stick. They recognise it as a FAT disk.
    PLEASE help me save hours of time.
    Colin

    I'm guessing the reason you want to 'bundle' up the files is to avoid the slower copy speed of lots of small files? If that or the desire to compress the data is you reason for using a disk image, zip them instead. Windows and most Macs will be able to open the zip file without additional software and any Macs that are running Jaguar or older OS versions will almost certainly have Stuffit Expander which can also decompress zip files.

  • How to convert BLOB data into string format.

    Hi,
    I have problem while converting blob data into string format.
    for example,
    Select dbms_lob.substr(c.shape.Get_wkb(),4000,1) from geotable c
    will get me the first 4000 byte of BLOB .
    When i using SQL as i did above,the max length is 4000, but i can get 32K using plsql as below:
    declare
    my_var CLOB;
    BEGIN
    for x in (Select X from T)
    loop
    my_var:=dbms_lob.substr(x.X,32767,1)
    end loop
    return my_var;
    I comfortably convert 32k BLOB field to string.
    My problem is how to convert blob to varchar having size more than 32K.
    Please help me to resolve this,
    Thanx in advance for the support,
    Nilesh

    Nilesh,
    . . . .The result of get_wkb() will not be human readable (all values are encoded into some binary format).
    SELECT utl_raw.cast_to_varchar2(tbl.geometry.get_wkt()) from FeatureTable tbl;
    -- resulting string:
        ☺AW(⌂özßHAA
    Å\(÷. . . .You may also want to have a look at { dbms_lob | http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1015792 } "The DBMS_LOB package provides subprograms to operate on BLOBs, CLOBs, NCLOBs, BFILEs, and temporary LOBs."
    Regards,
    Noel

  • Is it possible to convert LabView data into OLE variant?

    Hi. I'm using Activex Data Objects (ADO) to communicate with MySQL. Some ActiveX methods give OLE variant output, with "Variant Type" like "VT_ARRAY|VT_UI1", "VT_UI1" or "VT_BSTR". With some deduction and trial and error is relatively simple to extract data from this OLE variants and convert them to LabView data types. The problem is when I try to input variant data to some ActiveX methods, it almost always give me errors, I suppose because it expects the same type of the outputs, this is: OLE variants. Now, the question is: ¿Is there any way to convert LabView data into OLE variant data? ¿How?
    I've been searching and found a lot of posts about problems when passing variant data into ActiveX, saying that sometimes SAFEARRAYs are needed, sometimes saying that there were some bugs in LV6, giving some workarounds to this bug and saying that it is fixed in LV7.1, but the supposed workarounds don't work and the bug is still present in LV7.1, if it is really a bug.
    I think that if I could put LV data into OLE variant shape I may find an answer and solution to this matter.
    Thank you
    Daniel R.
    UdeC - Chile

    Below I describe how to handle OLE Variants, but I wanted to mention that LabVIEW does have a Database Connectivity toolkit (http://sine.ni.com/nips/cds/view/p/lang/en/nid/6429) that has already created a set of VIs for ADO. You might check that out first.
    However, handling OLE Variants in LabVIEW is automatic. LabVIEW itself has a variant datatype. When you use the ActiveX property or invoke nodes and one of the parameters is an OLE Variant, it is automatically converted to a LV Variant. You can then use the LV Variant VIs (such as "Variant to Data" and "To Variant").
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Convert the date into user default date formate

    I am wrinting a bdc and i want to convert the date into user default date farmate ..please suggust the functiom module should i use...

    actually by using dats or d type you can get the user specific date itself.
    but if u have different dates format that need to be converted to the user specific date then you can follow below procedure
    1. retrieve the user format from usr01
        SELECT SINGLE datfm
          INTO w_datfm
          FROM usr01
         WHERE bname EQ sy-uname.
    pass w_datfm to the below FM (4th import parameter)
    2. create Z - FM and retrieve the user secific date
    FUNCTION ZFXX_USER_SPECIFIC_DATE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IW_DAY) TYPE  CHAR2
    *"     VALUE(IW_MONTH) TYPE  CHAR2
    *"     VALUE(IW_YEAR) TYPE  CHAR4
    *"     VALUE(IW_DATFM) TYPE  USR01-DATFM
    *"  EXPORTING
    *"     VALUE(EW_USER_DATE) TYPE  CHAR0008
    *1  DD.MM.YYYY
    *2  MM/DD/YYYY
    *3  MM-DD-YYYY
    *4  YYYY.MM.DD
    *5  YYYY/MM/DD
    *6  YYYY-MM-DD
    CASE iw_datfm.
      when '1'.
        concatenate iw_day iw_month iw_year
               into ew_user_date.
      when '2'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '3'.
        concatenate iw_month iw_day iw_year
               into ew_user_date.
      when '4'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '5'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when '6'.
        concatenate iw_year iw_month iw_day
               into ew_user_date.
      when others.
        clear ew_user_date.
    endcase.
    ENDFUNCTION.

  • How to convert system Date into DD-MMM-YYYY Format

    hi friends,
    please help me How to convert system Date into DD-MMM-YYYY Format.
    Regards
    Yogesh

    HI..
    data: w_dt(11) type c,
             w_month(2),
             w_mon(3).
    w_month = p_date+4(2). **p_date = given date**
    case w_month.
    when '01'.
    w_mon = 'Jan'.
    when '02'.
    w_mon = 'Feb'.
    when '03'.
    w_mon = 'Mar'.
    when '04'.
    w_mon = 'Apr'.
    when '05'.
    w_mon = 'May'.
    when '06'.
    w_mon = 'Jun'.
    when '07'.
    w_mon = 'Jul'.
    when '08'.
    w_mon = 'Aug'.
    when '09'.
    w_mon = 'Sep'.
    when '10'.
    w_mon = 'Oct'.
    when '11'.
    w_mon = 'Nov'.
    when '12'.
    w_mon = 'Dec'.
    endcase.
    Now...
      concatenate p_date6(2)  '-'  w_mon  '-'   p_date0(4)  into w_dt.
    write w_dt.

  • I am new to the ethernet communicat​ion using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.

    i am new to the ethernet communication using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.
    Solved!
    Go to Solution.

    Hi thanks for the help.
    Actually i am trying to send 10 sine signals from server pc to client pc. So i will bundle 10 signals in server pc and send it and in client pc i am unbundling it and need to save in TDMS format.
    Till unbundling i was able to do. TDMS format it is saving only last value. I need to save all the values. Kindly help me on same. I am attaching both the VI.
    Attachments:
    Client.vi ‏62 KB
    Server.vi ‏252 KB

  • Cannot insert date into numbers 3.1 using ctl shift d

    can no longer insert date into numbers 3.1 using control shift d

    Hi Gerald,
    If you are inserting the current date a lot, and want a simple keyboard combination to do it rather than fiddling with formulas in Numbers, here is an easy way that takes advantage of some neat functionality built into every Mac that is much easier than it sounds.  It requires the investment of just a few minutes of time to make a one-time setup of an "Automator service."  Thereafter inserting a date is just a menu pick or keyboard combination.
    1. Open Automator (in your applications folder) and choose Service as document type:
    2. Drag 'Run AppleScript' action from the left over into the right pane:
    3. Copy the following script and paste it into the right pane (replacing all of the default text in the pane):
    on run
              set date_ to ((current date) as string)
      set the clipboard to the date_
              tell application "Numbers"
      activate
                        tell application "System Events"
      keystroke "v" using {option down, shift down, command down}
                        end tell
              end tell
    end run
    4. At the top of the right pane choose 'no input' for 'Service receives' and 'Numbers.app' for 'in'. (On my machine I have the old Numbers renamed to Numbers09 so the script doesn't get confused).
    After you click the hammer icon (to "compile") your right panel should now look like this:
    5. Name the service "Today" or similar and move it to the Library > Services folder. (If it doesn't save automatically to that location you can File > Export in Automator, choose the 'Desktop' for 'Where', then in Finder open a new window and hold down the option key and choose Go > Library > Services, and drag Today.workflow from the Desktop into that folder.)
    That's it. The service is ready to go. Thereafter, whenever you want to insert the current date, just pick Today from the Services menu:
    6. Or, to make this even easier to access, choose Services Preferences and assign a keyboard shortcut to the service:
    SG
    Troubleshooting notes:
    This should "just work." But if it doesn't for some reason, try one or more of the following:
    - Rename the old Numbers (the one in the iWork '09 folder under Applications) to Numbers09 or similar.
    - Check to make sure you aren't using the same keyboard shortcut for something else.
    - Remove 'Day of the week' from your "Full" date format in System Preferences > Language & Region.
    - Try revising permissions under System Preferences > Security & Privacy > Accessibility > Privacy.

  • While uploading data into the r/3 using call transaction or session method

    hi experts
    while uploading data into the r/3 using call transaction or session method error occured in the middle of the processing then how these methods behaves it transfers next records or not?

    hai
    Session method: The records are not added to the database until the session is processed. sy-subrc is not returned. Error logs are created for error records. Updation in database table is always Synchronous.
    Call Transaction method: The records are immediately added to the database table. sy-subrc is returned to 0 if successful. Error logs are not created and hence the errors need to be handled explicitly. Updation in database table is either Synchronous or Asynchronous.
    While to transfer the data from the through if any errors occurs until the errors are the complete the data is not transfer to the SAP system.
    the system compulsory shows the errors. that errors are stored into the error logs (Transaction is SM35).
    so the session method should not return any value.
    In call transaction method data is directly pass to the SAP system.
    So its compulsory return the value.
    Because of the call transaction is the function.
    A function should return the value mandatory
    In session method errors stroed in SYSTEM GENRATED ERROR LOG.
    IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.
    FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.
    THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.
    THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"
    AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING.

  • How to insert one table data into multiple tables by using procedure?

    How to insert one table data into multiple tables by using procedure?

    Below is the simple procedure. Try the below
    CREATE OR REPLACE PROCEDURE test_proc
    AS
    BEGIN
    INSERT ALL
      INTO emp_test1
      INTO emp_test2
      SELECT * FROM emp;
    END;
    If you want more examples you can refer below link
    multi-table inserts in oracle 9i
    Message was edited by: 000000

  • Post data into Ajax function for Item type plugin

    Please advise how to post data into Ajax function for item type plugin
    Edited by: Casufi on Jan 16, 2013 7:44 AM

    Casufi wrote:
    Casufi wrote:
    Please advise how to post data into Ajax function for item type plugin
    Edited by: Casufi on Jan 16, 2013 7:44 AMI used the following code
    var get = new htmldb_Get(null, html_GetElement(''pFlowId'').value, ''NATIVE='||apex_plugin.get_ajax_identifier||''', $v(''pFlowStepId''));
    get.addParam(''x01'', node.data.key);
    gReturn = get.get();You should use this published true ajax API instaed. apex.server.process( pAjaxIdentifier, pData, pOptions )

  • Convert  multiple rows into single rows for the respective index name

    Dear Experts,
                             I want to convert  multiple rows into single rows for the respective index name,
                            Here is my query.
    SELECT user_tables.table_name, user_indexes.index_name, user_ind_columns.column_name
    FROM user_tables
    JOIN user_indexes on user_indexes.table_name = user_tables.table_name
    join USER_IND_COLUMNS on USER_INDEXES.INDEX_NAME = USER_IND_COLUMNS.INDEX_NAME
    where user_indexes.index_name not like '%PK%' AND user_ind_columns.column_name NOT LIKE '%SYS%'
    ORDER BY user_tables.table_name,user_indexes.index_name;
    Result of previous query
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCNTYPCFG1
    ENABLE_SERVICE
    T1
    IDX_ACCTTYPCFG1
    ACC_CODE
    T1
    IDX_ACCTTYPCFG1
    ACCTYPE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    MOBILE_NO
    T3
    IDX_ACTLG1
    ID
    Desired output required is
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCNTYPCFG1
    ENABLE_SERVICE,ACC_CODE,ACCTYPE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    ACCTYPE,MOBILE_NO
    please help.

    Maybe
    with
    user_tables as
    (select 'T1' table_name,'IDX_ACCNTYPCFG1' index_name,'ENABLE_SERVICE' column_name from dual union all
    select 'T1','IDX_ACCTTYPCFG1','ACC_CODE' from dual union all
    select 'T1','IDX_ACCTTYPCFG1','ACCTYPE' from dual union all
    select 'T2','IDX_ACCTTYPCFGAPP1','ACCTYPE' from dual union all
    select 'T3','IDX_ACTLG1','MOBILE_NO' from dual union all
    select 'T3','IDX_ACTLG1','ID' from dual
    select table_name,
           case index_name when 'IDX_ACCNTYPCFG1' then 'IDX_ACCTTYPCFG1' else index_name end index_name,
           listagg(case column_name when 'ID' then 'ACCTYPE' else column_name end,',') within group (order by null) column_name
      from user_tables
    group by table_name,case index_name when 'IDX_ACCNTYPCFG1' then 'IDX_ACCTTYPCFG1' else index_name end
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCTTYPCFG1
    ACCTYPE,ACC_CODE,ENABLE_SERVICE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    ACCTYPE,MOBILE_NO
    Regards
    Etbin

  • Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin

    Hi ,
    We have a catalog that defines 2 types of products (they have too many different properties), so wanted to keep them on two different MDEX engines and serve the applications requests. Here DB catalog and front end ATG application is same for both the MDEX instances.
    Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin?
    Thanks
    Dev

    Hi, also have had some problem some monthes ago - I created separete component ProductCatalogSimpleIndexingAdminSecond. After that one of my colleage gave me some advice:
    The creating separate component like ProductCatalogSimpleIndexingAdmin for the second IOC is possible way for resolving your situation. But I afraid that this way will be required creating mane duplicates for already existed components.
    In my opinion the better way is the following:
    starting from AssemblerApplicationConfiguration and ApplicationConfiguration component. It contains details for connecting between ATG and Endeca. Of course you should configure different components for different Endeca Apps.
    After that:
    Find all components that uses AssemblerApplicationConfiguration and ApplicationConfiguration. Customize these components for using one or another  *Configuration component depending on what index works. (many variants released it: the most simple global custom component with flag.)
    Then customize the existed ProductCatalogSimpleIndexingAdmin. Using one or another IOC  and setting the flag in global custom component when index started. You can add some methods into your custom ProductCatalogSimpleIndexingAdmin like:
    Execute baseline index for both IOC (one by one)
    Execute baseline for IOC 1
    Execute baseline for IOC 2.
    Note: you should be afraid about incremental (partial) index in this configuration. But resolving conflicts in incremental index should be done after full implementation these changes.
    Regards

  • How do I convert ASF files on my Mac for use with FCE HD?

    Can anyone shed some light as to converting asf files into mov or dv using my mac? I did try using windows media player on my mac and the error was "Windows Media Player cannot play this file because the Player does not support this codec. Windows Media Player 7.1.3
    I also tried Streamclip with no success. Thank you in advance, MilliMac

    RiverPast Video Cleaner and Yasa Video Converter claim to convert ASF to DV but they are both pc applications ...

  • HT4061 Hello, I was wondering if you could convert the IMEI # into the serial number using letters and digits?

    Hello, I was wondering if you could convert the IMEI # into the serial number using letters and digits?

    No the imei from what I understand is a randomly given number. to get serial number you must have it. you can try supportprofile.apple.com and login.

Maybe you are looking for

  • Session management and java Web Service

    Hi , Can I have two web services one based on Session bean and other on Simple java class, packaged into single ear file? Does NetWeaver supports web service session management/tracking? How can I get an handle to HttpRequest in my Web Service? Any h

  • My calendar items are not syncing via iCloud.

    My calendar items are no longer syncing from my iPhone to my iMac via iCloud.  In Settings - iCloud, my iPhone says that Calendars are syncing.  iTunes on my iMac says the same thing.  On my iMac, iCloud settings won't let me check Calendars, though.

  • Replacing/ fixing the Logic Board yourself

    Hi there, I have taken my iBook (dual USB, @ 700MHz, 20 GB HDD) to this Apple Store in Buenos Aires, which I'm pretty sure has a fried Logic Board. They told me up front that the cost wil be around 700 U$S, and that the warranty will be 90 days. I'm

  • Perform URL Encoding in a Text String

    I need to be able to convert some characters ("/", ":", "@", " ") in a few text strings (SentDate, SentTime, EmailAddress) so that the strings can be incorporated into a URL that will be passed to FileMaker Pro Unlimited. SentDate is currently "2/22/

  • Update record in Pre-update

    Hi all, I got the master-detail block, where only certain field in child block for which are allow to updated. Hence, i have the update statement in pre-update trigger. UPDATE OT_PO_ITEM_DEL SET PID_UPD_UID = 'BC' WHERE PID_PI_SYS_ID = :OT_PO_ITEM.PI