convert datetime to decimal format

Does anyone know how to convert a datetime (as 2015-06-10 07:30) in a decimal number that is similar to:

42165.450 where 42165's days and 450 is minutes?  If I try the following:

------------------------------------------------------------------

< cfset dtNow = '2015-06-10' / >

< cfset dtOne = CreateDateTime)

Year (dtNow)

Months (dtNow).

Day (dtNow).

07, <!--> 18:00

30, <!---30 minutes. ->

00 <!---0 seconds. ->

) / >

<!-empty result. ->

< cfdump var = "#NumberFormat (dtone, '99999.99999') #" / > < br / > ""

------------------------------------------------------------------

I find myself with 42165.31250

Thank you

Padding with zero is not the answer. What you write in fact comme.720 et.1218 are, in fact, not decimals.

As you suggested, 720 and 1218 values represent for several minutes. Thus, the duration, in minutes, for dates (2015 - 06-16 at 12:00) and (2015 - 06-16 at 20:18) are, respectively, 12 x 60 = 720 and 20 x 60 + 18 = 1218. You can solve the problem in 2 ways:

1)

Interpret values 42170 / 720 and 42170 / 1218, respectively, as 42170 + 720/1439 =42170.500 and 42170 + 1218/1439 =42170.846

2)

Take a step back to my last post. You can determine the date reset your system as follows.

You know that the date (2015 - 06-16 at 12:00) equals (42170 days + 720 minutes) after the date of zero. Everything by converting the minutes gives (42170 x 24 x 60 + 720) = 60725520 minutes. You then

Zero date: #dateAdd("n",-60725520,myTestDate) #

This tells you that your zero date is 1899-12-30 23:00, which equals createDatetime (1899,12,30,23,0,0). You can then use that date zero as the basis for all other date calculations.

Suppose you want to find a date corresponding to the format number_of_days / number_of_minutes, for example, 42170 / 1218. All you need to do now is convert everything in minutes and add to the zero date. Therefore,.

#newDate #.

Tags: ColdFusion

Similar Questions

  • Readed hexadecimal string converted to a decimal number.

    Hello! I do a vi to check the hours of the lamp of my Sony projector. I send a hexadecimal command which is: A901 dignitaries 1301 0000 139 a senators. When the projector receives answer with 1901 1302 0031 339. 0031 corresponds to the data that I need to convert it to decimal because it tells me how many hours we used the lamp. How can I get this read-separated string to get only the third part of hexadecimal numbers converted to decimal? Thanks in advance!

    Hey rounded!

    As the data is in a format string, the hexadecimal number VI string should work well in this case.

    To enter only a single figure of this string to use in the hexadecimal number string VI, then I suggest using the string subset VI; Returns a specified segment of a string. By changing the offset of entry which determines which part of the string data is beginning to be analyzed from and changing the length to control the amount of characters to analyze, you will be able to enter the character that you want to convert.

    Kind regards

  • How to convert DateTime xml in xdp (Designer)?

    Hi, I want to convert DateTime format an XML in the designer, the value DateTime in xml format is NOT in common format YYYY-MM-DD (if it is in a common format, can I do this with pattern)

    I have a 'DateTime' field in Xdp can obtain Xml date and time:

    In XML < DateTime > DD-MM-YYYY < / DateTime > I want to convert in XDP in DateTime Field in 'April-DD-YYYY ".

    Can I do this?

    You can do this way...

    Bind the date field in your XML tag.

    Set the model display to the date field.

    Place the following code in the initialize event of the date field.

    The value JavaScript as a language.

    var dtStr = this.rawValue;
    var pos1 = dtStr.indexOf ("-");
    var pos2 = dtStr.indexOf ("-", pos1 + 1);
    var strMonth = dtStr.substring (0, pos1);
    strDay = dtStr.substring var (+ 1 pos1, pos2);
    var strYear = dtStr.substring (pos2 + 1);

    Assign the value to put in shape to the Date field.

    this.rawValue = strYear + '-' + strMonth + '-' + strDay.

    Thank you

    Srini

  • Convert hexadecimal into decimal and keep the zeros on the left...

    Hello

    I hope you can help us?

    How to convert hex to Decimal and keep the zeros

    I read 002C, hex, and I want to convert it to decimal-0044.

    sscanf (MyNum, % '4 x', & DecNum); will only give me 44.

    It worked until I started having zeros.

    We will always have a 4 digit hexadecimal entry in a range

    We have the 00 leader in this case.

    How is this best?

    Thanks for the help

    Simon

    Hello

    I don't really understand your problem. Is this kind of things that you need?

    int main (int argc, char *argv[])
    {
        const char MyNum[] = "002C";
        int DecNum;
    
        sscanf (MyNum, "%4x", &DecNum);
        printf ("%04d", DecNum);
        getchar ();
    
        return 0;
    }
    

    '0044' appears on standard output when executing the printf function...

  • How to convert .mix files usable format (.jpg)

    How to convert files *.mix usable format (*.jpg) My *.mix files that were created by MS Picture it! and MS Digital Image Pro. Help, please!

    How to convert files *.mix usable format (*.jpg)  Went to Windows 7 & XP new computerfrom due to a failure of the computer.  Fotrunately my pictures have been saved, but the window in course (or other) photo products can not access my files *.mix created by MS Picture! and MS Digital Image Pro.  Help, please!

    Hi Genecec,

    There is no converter of Microsoft or the viewer that will help you to see old photos of your. Although you can use some third party software to convert the .mix .jpg files.

    Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    You can follow the link given below and check if the given suggestion is useful.

    http://social.answers.Microsoft.com/forums/en-us/wlmedia/thread/12e62153-35b2-40F0-8da4-ae6450e085b0

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Convert char to date format in obiee 11g?

    Hello

    I want to convert char to date format in obiee 11g.

    I have this date

    ' 07/31 /' | CAST (YEAR (CURRENT_DATE) AS CHAR)

    I want to change the tank to the date format.

    Please help me,

    Thanks in advance,

    A.Kavya.

    Below him is based on my date format NLS source Oracle database as DD-MON-RR (query on the database - SELECT * > OF nls_database_parameters WHERE the PARAMETER = "NLS_DATE_FORMAT").

    Note that this is not altered by the connection of the RPD pool, which is common.

    If the date that I put together for substrings and Casts a match before it can be LAUNCHED as a DATE. IE 31 July 15 etc.

    Steps to follow:

    -Drag a field to the report, one

    -Change the formula

    -Paste in

    CAST ("31 - Jul -" |) SUBSTRING (CAST ('F_PL_BAL'. ' BUSINESS_DATE ' AS CHAR) FROM 8 TO 2) AS DATE).

    -OK

    -See the results

  • How to convert photos in jpeg format?

    What happens if I want to convert to jpeg? When you transfer the pictures from my Nikon to the ipad, it converts automatically in jpeg format. I would like to convert to JPEG so that I can download other apps/web apps for sharing.

    Separated from -.

    https://answers.Microsoft.com/thread/60bba06b-6e35-4eb0-9547-b217bd02b4bb

    There are several ways to do it, but here I'll show you how do it without having to download other Windows programs.

    1. Right click on image, choose open with and select Paint from the list.
    2. In the painting, choose file > save as to save a new copy.
    3. Before you save it, choose "JPEG" from the "file type" drop-down box.

    That's all, now you have a JPEG version of your image.

  • I have seconds in digital format, I need to convert this number to format MI: SS

    Hi all

    I have seconds in digital format, I need to convert this number to format MI: SS

    ex SEC 119-> 01:59 you guys can help me?

    s 900-> 15:00

    can you help me?

    Thank you all.

    Hello

    Here's one way:

    SELECT TO_CHAR (TO_DATE (119 ' SSSSS'), 'MI: SS') FROM DUAL;

    SQL > SELECT TO_CHAR (TO_DATE (119 ' SSSSS'), 'MI: SS') FROM DUAL;

    TO_CHAR (TO_DATE(119,'SSSSS'),')

    ------------------------------

    01:59

    SQL >

  • How to convert the Minutes (digital format) to hh: mm in SQL

    I have a column of data (Duration_Min_Amount) that displays the number of minutes used. I need to convert it to the format hh: mm and can't seem to figure out how.

    I need the data to show 930 = 15:30.

    Someone knows how to do this? I searched google and tried using CAST but cannot get the syntax works.

    ((A.DURATION_MIN_AM) / 60) |': ' | TO_CHAR (mod (SUM (A.DURATION_MIN_AM), 60), 'FM00') AS DURATION_MIN_AM,

    First display, sum the latter.

    or

    RTrim)

    LTrim)

    RTrim)

    NUMTODSINTERVAL (SUM (A.DURATION_MIN_AM), "OTHER")

    ,'+0: ')

    ,'+0: ')

    ,'.') AS DURATION_MIN_AM_I,

  • After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    After you create an action to reduce the size and convert them to JPEG format, how to eliminate the word "copy" of each image name?

    You can batch process using the image processor script and no user action should still be included in the process.  Check out our menu file > Scripts > image processor.

  • How can I convert JPEG to DOC format?

    How can I convert JPEG to DOC format?

    I scanned the documents that I want it in .doc format. !

    Hi Shalini,

    One possible solution is to convert jpeg to pdf and export this pdf in .doc format.

    You can buy the pack Acrobat PDF membership: https://acrobat.adobe.com/us/en/products/pdf-pack-pricing.html

    and use the web interface for hassle-free conversion: http://cloud.acrobat.com/

    Kind regards

    Rahul Tyagi

  • I can convert pdf to word format adobe acrobat, DC but my version of word is not correct because after conversion, fonts and lines are not correct in the original pdf document.  I am currently using version 6.1 of windows 7 service pack 1 build 7601. Is -

    I can convert pdf to word format adobe acrobat, DC, but my version of word may not be correct because after conversion, fonts and lines are not correct in the original pdf document.  I'm currently using version 6.1 of windows 7 service pack 1 build 7601 Home Premium. Is it possible that I might have to upgrade my windows 7 in order to get good conversions of PDF files in word files?

    No, it won't be linked to your version of Windows. Probably, you wait too long. Conversion cannot be perfect except for the files very easy.

  • Using Acrobat XI with IE11 and Win7; I can't the acrobat toolbar. Watch modules Manager he's here and activated, but the toolbar is not there. And when I use right click and click on convert to Adobe pdf format, nothing happens.

    Using Acrobat XI with IE11 and Win7; I can't the acrobat toolbar. Watch modules Manager he's here and activated, but the toolbar is not there. And when I use right click and click on convert to Adobe pdf format, nothing happens.

    Can anyone help?

    Hi Richard,

    1. start Internet Explorer.

    2. Select Tools > Internet Options, and then click the Advanced tab.

    3. check if "enable third-party browser extensions (requires restart)" and click OK.

    4. close all Internet Explorer Windows.

    5 restart Internet Explorer.

    Let us know how it goes.

    You can also check out the following link and see.

    Quick fix | See a PDF on the Web

    Concerning

    Sukrit diallo

  • I don't understand.  I use Google Docs to write letters and other shapes, and then convert them to PDF format using Adobe Acrobat.  If firm forms Central, I will still be able to do this?

    I don't understand.  I use Google Docs to write letters and other shapes, and then convert them to PDF format using Adobe Acrobat.  If firm forms Central, I will still be able to do this?

    No, if you do not use FormsCentral its disappearance will not affect you.

  • Convert number to date format

    HI team,

    I have a problem, how we can convert number in date format?
    This is the result of the query.

    SQL > col START_TIME for 999999999999999999999999
    SQL > select start_time in qrtz_triggers;

    START_TIME
    -------------------------
    1364243906000
    1364589406000

    So, I have to change the date format niumber rto.

    My date format as for example: "" Mar 25,2013 20:36:45 ""


    Please suggest me...
    Thank you
    Chavigny

    Published by: 939938 on March 14, 2013 06:39

    This is the number of milliseconds since January 1, 1970.

    SQL> SELECT to_char(to_date('01/01/1970','mm/dd/yyyy')+1364243906000/24/60/60/1000
      2  ,'Mon dd, yyyy hh:mi:ss PM') FROM dual;
    
    TO_CHAR(TO_DATE('01/01/1970','
    ------------------------------
    Mar 25, 2013 08:38:26 PM
    

    So in your query instead of start_time use
    TO_CHAR (to_date (' 01/01/1970 ',' mm/DD/yyyy') + start_time/24/60/60/1000,' Mon DD, YYYY HH: mi: ss PM "")

    Published by: kendenny on March 14, 2013 08:31
    Had used mm instead of e for the minutes.

Maybe you are looking for