Problems converting FILETIME date/time into MM/DD/YYYY format...

Has anyone successfully converted a FILETIME date/time value into a MM/DD/YYYY format using ColdFusion? I am failing drastically, and it seems like an easy conversion.
FILETIME format (details: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284(v=vs.85).aspx) is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
A database I'm working with has such values, and I want to display them in a user-friendly date format within my application.
For example, one record is:
13003368600
The above number represents the following date and time:
1/22/2013 @ 2:50 PM
Sadly I know this only because the FILETIME value gets written to the database by a third-party application, and within that application I specify it in the MM/DD/YYYY format.
Can anyone offer me some guidance, or better yet has anyone accomplished this already and want to share code?

I did this, on cf9/linux, and it seemed to do the trick:
<cfscript>
Long = createObject("java","java.lang.Long");
Date = createObject("java","java.util.Date");
fileTimeToEpoch =
// take pwdLastSet From Active Directory, it's in filetime
pwdLastSet = JavaCast("long", Long.parseLong("130292682204519505"));
// take filetime and turn it into epoch/java - 1970/1/1
// http://www.silisoftware.com/tools/date.php - converted: jan 1, 1970 00:00 -00
javaTime = JavaCast("long", pwdLastSet - 116444736000000000);
// convert to milliseconds
javaTime = JavaCast("long", javaTime / 10000);
today = JavaCast("string", Date.init(javaTime));
</cfscript>
<cfdump var="#pwdLastSet#">
<cfdump var="#javatime#">
<cfdump var="#today#">

Similar Messages

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • Insert a value of type Date/Time into a database

    I am trying to insert a value of type date time into an access database. What is the format needed to insert the date/time.
    Thanks,
    -Amos

    I had all kinds of problems getting a datetime inserted into a SQl Server DB. Probably similar so this is what I do:
    String date = new String("01/01/97 12:00:00");
    stmt.setObject(1, date);
    I tried using TimeStamp's but found I got an occasional Fractional Truncation exception back from the driver. Never had a problem inserting a String using the setObject() method though.
    Hope this helps

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • Convert Epoch Date Time to Date Time format

    I am trying to convert Epoch Date time in GMT to Human Readable Date time format in UTC. I used the one below but it returns just the date in GMT but how can get datetime in UTC ?
    select To_Char( To_Date( '01.01.1970 06:00:00','DD.MM.YYYY HH24:Mi:Ss') + STARTIME / 86400,'DD.MM.YYYY HH24:Mi:ss') FROM HQ_AVAIL_DATA_RLE;
    I refered a couple of forums and applied everything, but still I wouldn't get the timestamp.
    Please note that i'm looking for datetime stamp, not just the date.
    Thanks in advance!
    Edited by: 830754 on Jan 27, 2011 11:18 AM
    Edited by: 830754 on Jan 27, 2011 11:19 AM

    Works for me. I see date and time (submitted 1000 for STARTTIME):
    select To_Char( To_Date( '01.01.1970 06:00:00','DD.MM.YYYY HH24:Mi:Ss') + 1000 / 86400,'DD.MM.YYYY HH24:Mi:ss')
    from dual
    TO_CHAR(TO_DATE('01
    01.01.1970 06:16:40Or do you mean something else?

  • Inserting logon date & time into a table

    hi,
    i want to insert the logon date&time into a table which have a field
    called log_track and data type as date. i want to insert the
    information as 'dd/mm/yyyy hh24:mi:ss' . I tried to insert with
    the follwoing
    insert into log_chek values ( to_date(sysdate,'dd/mm/yyyy hh24:mi:ss))
    but it is not taking the time...how to include the time also..? I am using oracle 8i
    thanks in adv
    kris

    Dates are stored as dates. You cannot select to store a date in date format like dd/mm/yyyy hh24:mi:ss. That is not your decision to make. It is stored as a date format as a binary value.
    How you want to view that date, is your decision. How must this binary date format value much be displayed as a text string?
    So, when inserting a date you insert it as a date. That simple.
    insert into log_chek values ( sysdate )
    When you want to view that date, you decide how you would like it to be displayed in human readable format:
    select TO_CHAR( log_date, 'dd/mm/yyyy hh24:mi:ss') as log_date from log_chek

  • 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.

  • How to convert a data set into a xml data and vice versa

    i am new to oracle with xml..
    my aim is to convert a data set into a xml data and vice versa..
    my work is as follows...
    my query:
    select rggpk,rggcode,rggname from ms_regiongeo
    to convert a data set into a xml*
    select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual;
    (this works fine and output of this query is as follows..)
    <ROWSET>
    <ROW>
      <RGGPK>201</RGGPK>
      <RGGCODE>Asia</RGGCODE>
      <RGGNAME>Asia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>1</RGGPK>
      <RGGCODE>OTH</RGGCODE>
      <RGGNAME>Others</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>21</RGGPK>
      <RGGCODE>COB</RGGCODE>
      <RGGNAME>Africa and Yemen</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>2</RGGPK>
      <RGGCODE>AUS</RGGCODE>
      <RGGNAME>Australia</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>23</RGGPK>
      <RGGCODE>IND</RGGCODE>
      <RGGNAME>Indian Sub Continent</RGGNAME>
    </ROW>
    <ROW>
      <RGGPK>24</RGGPK>
      <RGGCODE>TVM</RGGCODE>
      <RGGNAME>North America</RGGNAME>
    </ROW>
    </ROWSET>
    and to reverse this process, I tried a query like this..*
    select EXTRACTVALUE (XML_DATA,'ROWSET/ROW/RGGPK') as EMP_ID
    from(
            select XMLType(trim(replace(dbms_xmlgen.getXML('select rggpk,rggcode, rggname from ms_regiongeo'),'<?xml version="1.0"?>',''))) XML_DATA from dual
    )tab1but failed.. and raised with an eror: ORA-19025
    help me..
    regards,
    john

    Hi-
    my aim is to convert a data set into a xml data  You can refer to the below posts
    Adding namespace to XML output
    Re: how to convert table data in xml format based on the xsd.

  • Convert date in modal binding table into dd.mm.yyyy format

    DEar ALL,
    i have a date in the modal table, this value is coming from r/3 in yyyymmdd format. But i need to change its format to dd.mm.yyyy. How can i achieve it..i don't want to create my own table...pls suggest
    Regds,
    Anup.

    Hi Anup,
    Is the field that is coming from R/3 of type DATE?
    If yes then the conversion of the date should be automatic, and the display will be according to your locale, user language, browser language.
    You can set the format using
    String date = (new SimpleDateFormat("MM/dd/yyyy").format(new java.util.Date()));
    Hope this helps.
    Regards,
    Shubham

  • Bseg-bldat into  mm/dd/yyyy format ?

    Date : mm/dd/yyyy format
    I have bsak table’s field bldat … in my program
    I have to write into mm/dd/yyyy format
    Is there any function module available
    Or manually through offsets I have to do ?

    Hi,
    CONCATINATE bsak-bldat0(4) bsak-bldat4(2) bsak-bldat+6(2) into G_DATE.
    so G_DATE will have the format which you are asking ...
    if you want to userformat, i mean different users will have different formats in SAP, so if you want user specific format, then
    DATA: date type SY-DAtum,
          date1(10).
    MOVE:BSAK-BLDAT to DATE.
    WRITE: DATE to DATE1.
    so in DATE1 filed will have the user format
    Regards
    Sudheer

  • Converting Delivery Creation Date/Time into the Local Date/Time

    Hi
    I have two fields like 'Delivery Creation Date' and 'Delivery Creation Time' in ECC system . My user wants the Delivery Creation Date / Delivery Creation Time in Local time of Plants .
    For example :
    Delivery    Plant       DelivCreationDate       DelivCreationTime   DelivCreationDate(Local)   DelivCreationTime(Local)
    312456          1650               11/2/2007                     4:30                          11/2/2007                          3:30
    Here the Plant 1650 is in Mexico . The above delivery is created in Canada in ECC system according to the candain time .
    But user wants to convert the Candain Delivery Creation Date and Time into the Local Date/Time of specific plant .
    So we need to convert the  Candain Delivery Creation Date and Time into Mexico timings .
    How can it is possible this one and user wants to automate this process .
    Please let me know
    Mubeen

    DATA :
    timestamp like TZONREF-TSTAMPS,
    time like sy-uzeit,
    date like sy-datum.
    The following function module is used to convert the
    time and date into GMT timestamp
    CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
    EXPORTING
    i_datlo = <source_fields>-delivery_date
    i_timlo = <source_fields>-delivery_time
    I_TZONE = CAD'
    IMPORTING
    E_TIMESTAMP = timestamp.
    The following function module is used to convert the
    above obtained timestamp to MEX  timezone date and time.
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
    EXPORTING
    i_timestamp = timestamp
    I_TZONE = MEX
    IMPORTING
    E_DATLO = date
    E_TIMLO = time.
    CAD and MEX are variables i have used...
    the challenge is to find the canadian and mexican time zone....CAD and MEX.
    which you can get by performing a lookup in table T001W and passing country as parameter.

  • Write 32 channels thermistor data (temp in degree vs date/time) into xls file for all channels continuously.

    i am acquiring 32 channels thermistor data (temp in degree vs date/time) in waveform plot using array to cluster function  ,
    now my problem is how to write this data  into xls file for all channels continuously.
    please help me at the earliest & i am new to Labview.

    Hi Priyanka,
    Writing to excel file continuously is not a good idea, you can use ".CSV" or TDMS file format and once data acquisition is completed you can convert that to excel file using report generation toolkit.
    With Regards
    Miraz
    Kudos is better option to thank somebody on this forum

  • How to convert date  into dd mon yyyy format

    hi all,
    i have a problem in date format i am using date like below .
    <%java.util.Date date = new java.util.Date();%>
    i am inserting date into a table and its storing like this
    insert into tablename (d_date) values (date)
    and its inserting date like below
    Sun Oct 19 09:05:45 GMT+03:00 2003
    i want to fetch date in dd mon yyyy format.
    with this format i want to make a select query.i struck with the format conversion.
    how to do this.
    any comments please.
    any help

    hi all,
    i understand now where i am wrong.
    the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
    i executed the same code in a different server where date and time jones are english its working fine.
    All the problem is in regional setting and not the jsp code.
    <%
    String whtEverDateFormatYouWAnt = "dd MMM yy";
    String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
    out.print(str);
    %>
    Thanks a lot for the excellent solution.
    Thanks again.

  • Converting a date time to a date only

    Post Author: Dockman
    CA Forum: Formula
    I am working on a report that has a running total field.  The running total field keeps a running total and resets every time that a date changes.  the problem is that my dates include times, therefore the running total resets on every line.  How can I convert my date (in date time format) to be only a date so that it does not reset on every line?
    Obviously, I am not a programmer so I apologize if this is a stupid question.

    Post Author: yangster
    CA Forum: Formula
    if you are doing it inside crystal you can use the date functiondate({your.datetimefield})if you are doing it at the db level in a command this will vary depending on your db

  • Function module for converting German Data/Time to Indian Date/Time

    Dear All,
    My requirement is to convert German date and time to Indian date and time. Is there any function module available or any way we can get it?
    Thanks and regards,
    Atanu

    hi,
    first get the timezone of that country
    CALL FUNCTION 'TZON_LOCATION_TIMEZONE'
          EXPORTING
            if_country        = p_it_userid-zcountry
          IMPORTING
            ef_timezone       = l_tzone
          EXCEPTIONS
            no_timezone_found = 1
            OTHERS            = 2.
    then use the below statements
    -- Convert from server time to GMT
          CLEAR l_tstmp.
          CONVERT DATE l_datum
                  TIME l_ctime
             INTO TIME STAMP l_tstmp TIME ZONE sy-zonlo.
    *-- Convert from GMT to user backup time
          CONVERT TIME STAMP l_tstmp TIME ZONE it_usr_timezone-ztzone
            INTO DATE it_usr_timezone-zdate
                 TIME it_usr_timezone-ztime.

Maybe you are looking for

  • File download from the db.

    Hello, I'm using this standard? procedure to download files from the db. CREATE OR REPLACE procedure DOWNLOAD_MY_FILE_ATTACH (p_file in number) as      v_mime varchar2(255);      v_length number;      v_file_name varchar2(2000);      Lob_loc BLOB; be

  • Marking Fields as Read-Only After Digitally Signing Issues

    I am creating a PDF form that contains several digital signatures.  I am selecting a signatures and am in the property options for that specific signature looking at the "Signed" tab.  I select, Mark as read only, than choose "Just these Fields. When

  • Correct way to obtain AppModule from ManagedBean?

    hi, There are many posts on this forum and others in the net with examples on how to obtain an AppModule from a ManagedBean (some of them uses depecrated methods, like using ValueBinding). But what's the correct way to do so? Is this the correct one

  • Problem with InterMedia ClipBoard

    Hi i am trying to use the Code wizard to create the Get_object , put_object, insert_row procedures for inserting/updating BLOB data into oracle database However the code editior gives an error The code generated is as follows and the error is as foll

  • After iOS 5 update callers can't hear me

    I have an AT&T iphone 4 that was working great before the update. After searching online I found someone who suggested turning the speaker on and off, that worked a couple of times, but now no one can hear me. I went to AT&T and they hadn't heard of