Conversion of timestamp unix to #now () #.

I am trying to convert my personal website of PHP CF9 (I wanted CF10, but apparently, CF10/Linux is hard to find), and when import my existing blog posts in the new database, I found with unexpected date for post stamps.

A post from November of last year turned into a 5 digit year August.  I guess that's a thing of time unix, and since I will use #now () # for the posts to come, I'll need to convert the existing posts to use the new format.

I think I can just do a query update, but I have no idea how to transform the existing timestamps into something that the DateFormat() attribute will be able to be formatted correctly.  Any advice?

Try this function from CFLIB: http://www.cflib.org/udf/EpochTimeToDate

Jason

Tags: ColdFusion

Similar Questions

  • Convert timestamp Unix LabVIEW

    Hello

    I need to convert a dll to come froma Unix timestamp to a moment of LabVIEW. Now someone some ready to use of function for this?

    Thank you

    What is the data type of a unix timestamp?

    The unix time is 01/01/1970.

    The era of LabVIEW is 01/01/1904

    All you add is the number of seconds between two times (i.e., the value of a timestamp LabVIEW from 01/01/1970)

  • conversion of timestamp

    In the LV2009 extract attached, I use the "%b %Y % H: %m %d' for formatting timestamp in a time that looks like this: December 3, 2009 10:33.  Now what I want to do, is to receive a string (in this same format) and stuff it back into a TimeStamp.  How can I do this?

    My first work witht the format example you actually generate the second works with what you say you generated.

  • conversion of timestamp in dd-mm-aa

    Hello

    does anyone know how to convert a unix timestamp format dd-mm-aa? Ive tried to use the date_format function in SQL, but it does not work?

    Anyone have any ideas?

    the "created" field is timestamp.

    Thank you

    Kamesh192 wrote:
    > does anyone know how to convert a unix timestamp format dd-mm-aa?
    > ive tried using the date_format in SQL function, but it does not work?

    The DATE_FORMAT()) MySQL function is intended for the ISO dates (YYYY-MM-DD)
    only. To convert a Unix timestamp into a readable format, use FROM_UNIXTIME().

    "SELECT node.title, FROM_UNIXTIME (node.created, '%f %d %Y') as new_time,.
    node_revisions. INNER JOIN node_revisions node body ON node.nid =
    node_revisions.NID WHERE node.type = 'story' ORDER BY node.nid desc limit 1 "
    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to prevent the Automatic Conversion of TIMESTAMP Format column (0) WITH ZONE VARCHAR2

    Hello

    I created a view of my table and columns with the date format is automatically converted to varchar type...

    How can I avoid this?

    Create view V_T2 as

    Select

    MAX (DECODE (RESULT_TYPE, THE FROM ', DECODE (BACKUP_LEVEL_ID, 'F', LAST_START, NULL), NULL)) LAST_SUCCESS_FULL_START,.

    MAX LAST_SUCCESS_INC_START (DECODE (RESULT_TYPE,' TO DECODE (BACKUP_LEVEL_ID, 'F', NULL, LAST_START), NULL))

    of backup_log;

    the first 'LAST_SUCCESS_FULL_START' column format remains TIMESTAMP (0) WITH ZONE SCHEDULE, but the other changes to VARCHAR.

    the LAST_START column in my table in the source format is also TIMESTAMP (0) WITH ZONE SCHEDULE.

    Thank you for helping me.

    user649075 wrote:

    Create view V_T2 as

    Select

    MAX (DECODE (RESULT_TYPE, THE FROM ', DECODE (BACKUP_LEVEL_ID, 'F', LAST_START, NULL), NULL)) LAST_SUCCESS_FULL_START,.

    MAX LAST_SUCCESS_INC_START (DECODE (RESULT_TYPE,' TO DECODE (BACKUP_LEVEL_ID, 'F', NULL, LAST_START), NULL))

    of backup_log;

    The NULL value is treated as a VARCHAR2 since she does not have a real data type.

    Try to CAST as the appropriate data type.

    cast( null as timestamp(0) with time zone)
    

    MK

  • Conversion of TIMESTAMP to Date?

    Hi all

    I have this little materialized view where I use a session variable to fill.

    Say that I've seen like this.

    Select date, account, product, sum (balance) in the glbalance if date = "VALUEOF (NQ_SESSION.user_entered_date)" Grouper group by date, account, product


    Ideally, the SQL should look like: select date, account, product, sum (balance) in the glbalance if date = ' 28 / 02/2013 ' group by date, account, product



    I have a command prompt in the dashboard that fills the variable user_entered_date of query. but I defualted to a SystemDate in the repository.


    I have a report and this leads to a page of a dashboard. Whenever I open the page, it gives me an error. But when I select a date in the command prompt and run the report, and it works well.
    Its only when I open the page or the dashboard at the start, it is in error as syntax incorecct. I give the example below...


    The statement that is issued for the view in the present case is

    SET the VARIABLE user_entered_date =' TIMESTAMP "2013-02-28 00:00:00"'

    If date = "TIMESTAMP" 2013-02-28 00:00:00 "
    I'm not able to remove this word TIMESTAMP that is causing the error. How to do this?
    I have all the date columns in all the tables as DATETIME format only.


    When to start to choose the date at the COMMAND prompt, then SQL is published as: If date = ' 2013-02-28 00:00:00 ' is correct and properly executed.



    How remove the TIMESTAMP Word when I opened at the start of the dashboard... Any help?

    Current_date as good as sysdate as in Oracle.

    Use this
    SELECT dates.master_date 'DOMAIN' where dates.master_date = current_date

    For error; Difficulty is

    SELECT dates.master_date 'DOMAIN' where dates.master_date = cast (' 28 / 02/2013 ' as date)

    Check if help

    Published by: Srini VIEREN on February 28, 2013 10:49

  • string conversion number in Unix

    I'm extremely sorry to post this here. I googled a Unix category for this post here. But could not find one.
    I have a string in Unix. I need to remove characters from the string.
    var=2012/03/26
    I need to remove the special char's('/') from the string. It should be 20120326. 
    I tried expr substr, but did not get the result.

    Sorry again to post in the wrong category.

    Try

    newvar=`echo $var|sed 's/[^0-9]//g'`
    

    Who's going to shoot anything that isn't a digital character in the string in the variable ${newvar}.

    Seems you watch a channel that will (eventually) be interpreted as a date, what happens when the string 'date' lack of zeros? It won't be pretty.

  • Conversion of TimeStamp can be used as

    I've been using this script, which seems to be everywhere on the web, but get a different date for what is in my database:

    <? PHP {? >}

    < h3 > <? PHP echo $row_GetsNewsText ['post_title'];? > < / h3 >

    <? PHP $datetime = $row_GetsNewsText ['post_date'];

    $year = substr ($datetime, 0, 4);

    $mon = substr ($datetime, 4, 2);

    $day = substr ($datetime, 6, 2);

    $hour = substr ($datetime, 8, 2);

    $min = substr ($datetime, 10, 2);

    $sec = substr ($datetime, 12, 2);

    $orgdate = date ("F jS, Y", mktime ($hour, $min, $sec, $mon, $day, $year));

      ?>

    < h4 > <? PHP echo $orgdate;? > <? PHP / *? > <? PHP echo $row_GetsNewsText ['post_date'];? > <? PHP * /? > < / h4 >

    < p > <? PHP echo $row_GetsNewsText ['post_content'];? > < / p >

    <? PHP} while ($row_GetsNewsText = mysql_fetch_assoc ($GetsNewsText));? >

    I do not understand concerning the ORDER of the variables in $orgdate? I tried in different orders, which has varying effects, so this must be the key, I guess that?

    The two entries MUST show:

    January 8, 2010-June 15, 2010

    But what I get is:

    December 1, 2009-December 6, 2009

    I keep seeing January = 1 and June = 6, so we can assume I get close?

    I'm sure it's something obvious, but can't find it.

    This script appears only if it is based on the way the MySQL timestamps were formatted in MySQL 3.23 and 4.0.

    The old time stamp looked like this: 20101127204235.

    The same timestamp MySQL 4.1 looks like this: 2010-11-27 20:43:35.

    So you get the wrong timestamp with substring() definitions parts.

    However, if you use PHP 5.2 or 5.3, you can do it much more simply:

    $datetime = new DateTime($row_GetsNewsText['post_date']);
    $orgdate = $datetime->format('F jS, Y');
    
  • Date of submission to the conversion of TIMESTAMP variable

    Hello
    I have a date database table id column, a quick date with calendar and I need to show the number of days between the DATE_COLUMN and PROMPT_VALUE.
    I am selected storage prompt value in variable presentation PROMPT_DATE.
    I think, I need to use the TIMESTAMPDIFF function, but I have this problem:

    TIMESTAMPDIFF (SQL_TSI_DAY, DATE_COLUMN, ANOTHER_DATE_COLUMN) is OK

    but

    TIMESTAMPDIFF (SQL_TSI_DAY, DATE_COLUMN, CAST (' @{PROMPT_DATE}' as DATE))

    I got the error:

    [nQSError: 10058] A general error occurred. [nQSError: 46046] 01/04/2000 DateTime value does not match the specified format. (HY000) (...... TIMESTAMPDIFF (SQL_TSI_DAY, periods. ((' ' Month ', cast (' 01 / 04/2000 ' as date))...)

    I Don t know how to convert variable date of presentation by TIMESTAMP or another format, that I can use in TIMESTAMPDIFF function.

    I have an idea, but I'd like to find another solution. One solution might be to analyze variable presentation string, substring pieces 3 per day, mount, year and concat that parts in a single string, which can be used in TIMESTAMP call
    But I'm having a problem with the format of date and places. For example, in English, I'll have jj/mm/aaaa mask, in another language, I will have exact mask

    Can you help me?

    EVALUATE ("(%1, %2) TO_DATE', 'variable @dashboard',' the date format of the variable of dashboard")

  • UNIX timestamp to date

    Hello

    I use developer SQL to query an oracle 8 database and
    I need to convert a timestamp unix in a time format date - YYYYMMDD HH24:MI:SS

    I am currently using
    , to_date (19700101' 00:00: 01 ',' YYYYMMDD HH24:MI:SS') + sh.order_date / 86400

    but it returns just the date in the format DD-MMM-AA

    If you want a DATE to look a certain way, use TO_CHAR

    to_char (
       to_date('19700101 00:00:01','YYYYMMDD HH24:MI:SS')+sh.order_date/86400
    , 'YYYYMMDD HH24:MI:SS')
    
  • MySQL timestamp formatting errors

    I continue to have strange formatting errors when pulling data from a MySQL database.  I'm having now is with time values.

    The screenshot shows that the error is generated in the variant to Data.vi the real time stored in the database is from 08:30, but the conversion of timestamp, I get 8:29:59.999 unfortunately, there doesn't seem to be an easy way to 'around' this value to what I want either.

    I might go back to output string, because this particular error does not appear to spread in a chain.  But that mess with the rest of my application.  Return to the output chain cancels a couple of working days and leaves me with the problem of having to convert the string 'time' again in timestamp that LabVIEW can understand.

    The really weird thing is that 12:30 comes as 12:30 very well.  I don't know why that would be.  Any ideas?

    You can do this with the format string "% I: % h: %s %p %<%m/%d/%Y > T '

  • Notes to save smartphones BlackBerry or parts of emails / IM conversations

    Hello... I used to be able to take notes to myself or to save the relevant parts of emails or instant messaging conversations in a file and now I can't do it anymore or find previous saved items? I think that it used to be an icon in the applications tab or media but it it's gone... help? ! x

    Searching for memo application?

    Please explain how you used to do, and we might be able to help.

  • MISP 2.1: SYS. SOURCE$. Conversion of blocking SOURCES

    Hello

    I currently have a few thousand lines blocking the conversion of Unicode, the column of SYS. SOURCE$. SOURCE.

    They all State need (planned) conversion, no representation not valid etc.

    However, it is indicated in the documentation and help, the EDR should be able to handle this?

    BR,

    Kim

    I think I found the problem.

    It was two types, which contained comments convertible characters in their DDL.

    I had to delete the tables of AQ queue that they used in order to remove these types.

    Then I was able to proceed with the conversion - all green check marks now.

    Note: This is just a test run, in order to get a grip of the tasks ahead.

    BR,

    Kim

  • reports of conversion time

    Hello

    When we export a column counter usage report date time and time is converted to a number 13-digit

    is it possible to have the conversion algorithm to convert this value to the date and time?

    Concerning

    Daniel

    Hi Daniel,.

    The timestamp format that you see is a time timestamp (specifically a millisecond time timestamp). You can convert timestamps using something like http://www.epochconverter.com, although this is probably not accomplish what you're looking for. You are wanting the reports exported to show the timestamp as hh: mm: MM/DD/YY? If you need to present this as a feature request, but I'll do some tinkering in my lab to see if I can't export to this format.

    EDIT: a few quick searches turned a few posts on the MS forums discuss conversion Epoch timestamps in Excel. This link seems to include a formula that converts the timestamp of the time in an excel-readable format, which can then be converted to a human-readable format by setting the cell a Date/time format.

    http://www.MrExcel.com/Forum/Excel-questions/49217-converting-normal-time-epoch-time-format-using-Excel.html

    I have not tested yet, since the posters in the forum do not specify whether or not timestamps with which they deal are in seconds or milliseconds, then it may require additional conversion to make it work if they deal in seconds with the provided formula.

    EDIT again: I took the formula that they suggested in the link above and it seems to work only on the timestamps that are provided in a few seconds. As the time stamp that we provide is in milliseconds, you need to split the time value of 1000 as a result of the following formula:

    = ((A1/1000)/86400) + 25569

    Where A1 is the cell that contains the time stamp. I have provided a screenshot of this formlua in action below. Let me know if you have any questions. Sorry if all my editing is spamming your e-mail address.

    Final cut (I promise): I pulled a measure of consumption in excel report, to see if it was possible to convert the entire column, and so far the best solution I have found is the following:

    -Insert a new column between #Time and DNS host name (I called him 'Converted time')

    -Select the line below the title and your entry form (B11 in my case)

    -Formula ' = ((A11/1000)/86400) + 25569 "(with additional info at the top of the rerport values time started to A11)

    -Press ENTER to insert the formula

    -Select the cell containing the formula

    -Double click on the box in the lower right of the cell, it will apply the formula to all of the following lines

    -Select the column, and then right-click to open the menu "Format cell".

    -Define the colum 'Time' and select the desired format

    I hope this information was useful!

    -Chris

    Technical Support Engineer | VCP4

    VMware Support Global Services

  • Varchar-&gt; Timestamp

    Hello Experts,

    BANNER

    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE 8.1.7.0.0-Production
    AMT for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production

    select timestamp from all_objects;
    This is varchar2 (19) timestamp field.

    Now I need to get only of time, for example; 05-30 or 17-30.

    Help, please

    Thank you...

    Hello

    Linus wrote:
    Hello Experts,

    BANNER

    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE 8.1.7.0.0-Production
    AMT for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production

    select timestamp from all_objects;
    

    This is varchar2 (19) timestamp field.

    Now I need to get only of time, for example; 05-30 or 17-30.

    SUBSTR to get a part of a larger chain.
    http://docs.Oracle.com/CD/B19306_01/server.102/b14200/functions162.htm#sthref2169
    For example, if t = ' 2012/07/06 09-32-28', then

    SUBSTR ( t     -- source string
           , 12     -- starting postition
           , 5     -- length of returned sub-string
           )
    

    Returns the substring starting with the 12 character, which is 5 characters, in this case ' 09-32'.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.
    See the FAQ forum {message identifier: = 9360002}

    Moreover, from Oracle 9, TIMESTAMP is an Oracle reserved word, and you can be difficult to use as the column name if you ever upgrade. If it is not too late, rename your column. TIME_STRING would be a better name, anyway, since this column is a string of characters.

Maybe you are looking for