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/

Tags: Dreamweaver

Similar Questions

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

  • 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

  • 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

  • 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")

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

  • 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

  • The automatic procedure every night 12: 00

    Hello..
    I m new in oracle.please answer me briefly what I can learn more...
    I have a day_load procedure name
    I want it run automatically each day to night 12: 00... can someone tell me how can I do this?
    I'm waiting for your answers.
    Thanks in advance...

    Hi sajid,.

    The start_date to the dbms_scheduler.create_job argument is of type TIMESTAMP WITH time ZONE SCHEDULE. You pass a string and must never depend on the implicit conversion to timestamp.

    So, for start_date do something like this

    start_Date   =>  to_timestamp_tz('01-JAN-2003 10:00:00','DD-MON-YYYY HH24:MI:SS')
    

    If you are unsure if you job has actually been created, see user_scheduler_jobs. If has been created, you can see on user_scheduler_jobs.state if he ran and failed.

    select *
      from user_scheduler_jobs
     where job_name = 'JOB3';
    

    More information about the performance of the work can be seen from

    select *
      from user_scheduler_job_run_details
     where job_name = 'JOB3';
    

    Concerning
    Peter

  • Dynamic repository default Variable initialization

    Using Oracle BI (10.1.3.3.2) administration tool, I created a repository Variable Init block, the Data Source, the set as default initialization string:

    Select cast (trunc (sysdate)-1 date) of the double

    and associated with a target Variable, dynamic repository Variable, default initializer, generator expressions, the Variable defined without any error message like:

    DATE ' 2008-12-11.

    Whenever I have save the repository using the administration tool, this definition of the variable converts without warning to:

    TIMESTAMP ' 2008-12-11 00:00:00 '

    How can I stop the conversion of TIMESTAMP DATE in the default initializer?

    Use to_char in your sql instead of using the cast function. For tank allows you to mention the format.

    Select double To_Char(Sysdate-1,'MM/DD/YYYY').

    -Madan

  • Is there a way to see the timestamps of all messages in a conversation?

    I have time stamps for messages under tension, but I seem to only get a timestamp in early conversations. If more than one hour or so passes, then I will get another timestamp. But I would really like to see timestamps for each message. Is there a way to enable this feature or am I the GROUND?

    Thank you

    Matteo

    Put your finger on one of the messages, and then drag to the left. You should see the schedules for all messages.

  • BlackBerry smartphones received Timestamp error in the SMS Conversations

    Hello. I recently moved to Michigan from California and the parameters of time on my blackberry automatically goes to the Eastern (-5) time. However, whenever I receive an SMS (no), the timestamp for the SMS received into the conversation is 3 hours earlier than the actual time / unit. It is a problem within the conversation; When I return to the main folder of Messages or SMS, the timestamp of the last message received/sent next to the contact's name is correct. Is it possible to fix this outside to do a thorough cleaning? I tried restarting and manually changing the date and time; did not help.

    BlackBerry Bold 9650

    V5.0.0.732

    Verizon Wireless

    Hiya!

    Timestamp is generally assigned when the SMS through your door VLR (visitor location register) on the way to the tower to which you are connected. So, in this case, you can connect to the bad VLR and your provider would have to reset. If you did a battery pull and it did not help. I recommend to call your operator and ask them to re-enter their network. That you attach to the router/VLR closest

    (Edited to explain the abbreviation)

  • Conversion problem 8i to oracle 11g database timestamp

    Hello
    I have an interface that migrates data from 8i to Oracle 11 g server. I use ODI 10.1.3.5 version for this migration.
    When we try to send the timestamp from 8i to 11g, time stamp values are coming as parag 00:00:00.
    I tried almost all the functions of conversion posible as to_timestamp (tochar(field,format), format).
    The above mentioned is the last conversion I used which is insert 0 in the timestamp.
    Please let me know the resolution if someone has experienced the same problem.

    Thank you
    Naveen

    Hello

    Maybe you can try with this...

    Add a topology for the JDBC url property.

    Key = oracle.jdbc.V8Compatible
    Value = true

    Thank you
    Fati

  • DATE in TIMESTAMP data type conversion

    Hello

    My question is this:

    1. I have a variable of type DATE, which I attribute the value of SYSDATE
     mydatevar DATE:= SYSDATE;
    2. I want to find * «today» *, truncated to DATE
      TRUNC (mydatevar, 'DD')
    TRUNC function returns the DATE data type. So I get to the point for example 2 *'2010-01-13 00:00:00 ' *.

    3. I want to assign the value of the point 2, to a variable of type TIMESTAMP
      mytimestampvar TIMESTAMP := mydatevar;
    implicitly that will convert the variable DATE to TIMESTAMP.

    Problem: when converting (implicit and explicit conversion with a format mask), I lose hours "00" and "00" minutes and receive something like this: "10 January 13 * 12 *. 00.00.000000000 AM.

    Question: How can I convert a DATE to TIMESTAMP keeping the hours and minutes zeros?

    Why I need this conversion: I have a table with one "column1" TIMESTAMP column (0) and I take only the rows of the table, where 'column1' is in the range of today 12:00 in the morning until now (what time it is).

    Features of the database NLS:
    PARAMETER                           VALUE
    NLS_LANGUAGE                           AMERICAN
    NLS_TERRITORY                   AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY                    AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET                    AL32UTF8
    NLS_CALENDAR                            GREGORIAN
    NLS_DATE_FORMAT                    DD-MON-RR
    NLS_DATE_LANGUAGE            AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT                     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT             DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                             BINARY
    NLS_LENGTH_SEMANTICS               BYTE
    NLS_NCHAR_CONV_EXCP             FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION             10.2.0.4.0
    Session settings are the same.

    DBTIMEZONE is "+ 02:00".

    Verdi wrote:
    Problem: when converting (implicit and explicit conversion with a format mask), I lose hours "00" and "00" minutes and receive something like this: "10 January 13 * 12 *. 00.00.000000000 AM.

    I don't think you lose necessarily any information whatsoever. It is probably more a function of your NLS_TIMESTAMP_FORMAT and NLS_DATE_FORMAT. For example, your NLS_DATE_FORMAT could be default setup for a HH24 (24 hours) which would report to midnight as hours of "00". However, it seems that your NLS_TIMESTAMP_FORMAT is configured with "HH" format with a Meridian indicator that means 12 hours time.

    Your comparisons should use date/timestamp data types anyway, so as long as the input value is correctly converted to date type that shouldn't matter in any case.

    You can see what is actually stored by using the DUMP function:

    SQL> SELECT  DUMP(TO_TIMESTAMP(TO_CHAR(TRUNC(SYSDATE,'DD'),'MM/DD/YYYY HH:MI:SS AM'))) AS TSTAMP
      2  ,       DUMP(TRUNC(SYSDATE,'DD')) AS DT
      3  FROM DUAL
      4  /
    
    TSTAMP                                                                      DT
    --------------------------------------------------------------------------- --------------------------------------------------
    Typ=187 Len=20: 218,7,1,13,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0                  Typ=13 Len=8: 218,7,1,13,0,0,0,0
    

    As you can see the TSTAMP and DT store almost the same values (218,7,1,13), but the TSTAMP has more precision because of fractions of a second.

    HTH!

    Published by: Centinul on January 13, 2010 07:23

Maybe you are looking for