Converting timestamp to dd-mm-yy

Hi
does anyone know how to convert a unix timestamp to readable
dd-mm-yy format? ive tried using the date_format function in SQL
but that doesnt work?
anyone have any ideas?
the field "created" is the timestamp.
thanks

Kamesh192 wrote:
> does anyone know how to convert a unix timestamp to
readable dd-mm-yy format?
> ive tried using the date_format function in SQL but that
doesnt work?
The MySQL DATE_FORMAT() function is for use with ISO dates
(YYYY-MM-DD)
only. To convert a Unix timestamp to a readable format, use
FROM_UNIXTIME().
"SELECT node.title, FROM_UNIXTIME(node.created, '%F %d %Y')
as new_time ,
node_revisions.body FROM node INNER JOIN node_revisions ON
node.nid =
node_revisions.nid WHERE node.type='story' ORDER BY node.nid
desc limit 1"
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Converting timestamp with timezone to milisecs

    Hi guys,
    How to converting timestamp with timezone to milisecs?
    I'm using oracle 10g.

    SeánMacGC wrote:
    Hello, do you mean:
    SQL> select to_char(systimestamp, 'SSSSS') from dual;
    TO_CH
    58435
    'SSSSS' Format Model returns 'Seconds past midnight' not milliseconds. I wonder if OP meant Fractional Seconds?
    SQL> SELECT TO_TIMESTAMP_TZ('1999-12-01 11:00:00.00532 -8:00',
      2         'YYYY-MM-DD HH:MI:SS.FF TZH:TZM') col_1 FROM DUAL
      3  /
    COL_1
    01-DEC-99 11.00.00.005320000 AM -08:00
    SQL> SELECT TO_CHAR(col_1, 'FF') fractional_sec FROM
      2  (SELECT TO_TIMESTAMP_TZ('1999-12-01 11:00:00.00532 -8:00',
      3         'YYYY-MM-DD HH:MI:SS.FF TZH:TZM') col_1 FROM DUAL)
      4  /
    FRACTIONA
    005320000
    SQL>Regards,
    Jo
    Edited by: Joice John : Added Code Tags

  • Remote enabled FunctionModule to convert Timestamps

    Hello,
    I need your help. I am searching for an SAP-FunctionModule that convert Timestamps from UTC to other time zones. The FunctionModule should be remote enabled and SAP standard (similar to FunctionModule = “TZ_GLOBAL_TO_LOCAL”).
    Perhaps you can help me.

    Hi Sam,
    thank you very much for your answer. But we don´t like to build up a custom Z-function. We need a SAP-Standard remote enabled functionality (BAPI or Function).
    I there really no standard functionality.
    Holger

  • Convert timestamp to string with milliseconds showing.

    I have two questions. The first is I need to know how to convert the timestamp that displays from "Get Date/Time in seconds" to a string format.  I found the vi that converts to string but it stops at seconds and cuts off the milliseconds. I wired true to the "Get seconds" terminal so I get the time in seconds, I just don't get the millisecond value. Also I need to know if the clock from "Get Date/Time in seconds", is synchronized (or shows the same time down to the millisecond) with the timestamp that shows in the CAN read vi. I need to have the clock/timestamp from the CAN read synchronized with the "Get Date/Time in seconds" clock/timestamp. I am trying to compare delays in the CAN so I need precision down to the millisecond.

    Use Format Date/Time String.  For the format code use %H%M%S%4u to get two digits for hours, two digits for minutes, two digits for seconds, then a decimal, and after the decimal you get 4 digits for fractions of a second.  Replace the 4 with a 3 to get milliseconds, or with a 1 to get tenths of a second.   You get the idea...  See attached vi.
    - tbob
    Inventor of the WORM Global
    Attachments:
    Milliseconds.vi ‏12 KB

  • Function Module for converting timestamp

    Hi all
    I have a scenario where in the timestamp is getting stored in a z table in the UTC format (i.e. 20,100,125,080,528).
    Now when i have to display this value to the user, it should be like "25.01.2010 08:05:28". Is there any standard function module to accomplish this? or is it like i have to do it in my code using the offset?
    please guide me.
    Thanks in advance.
    Regards
    Gaurav

    Hello
    Use this:
    DATA:
    tstamp  TYPE timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO DATE d TIME t.
    Just press F1 on TIME STAMP.

  • Convert timestamp from text file (hh:mm:ss) into seconds

    How can I import a column of time stamps from a text file of the form hh:mm:ss and convert it into seconds using LabView? For example, 13:30:30 into 48630.
    Also, using the "Read from Spreadsheet File VI" I can't seem to get the entire time stamp imported correctly. Only the value before the colon is read. For example, if the timestamp reads 13:30:30, only 13 is inputed into the array in LabView.
    FYI I'm using LabView 7. Thanks!

    Here's a LV 7 example. Just a Scan From String, a couple of Multiply functions and add the results. As far as your Read From Spreadsheet issue, by default, the function creates an array of SGLs. 13:30:30 is text and the functions needs to be modified to return an array of strings. There are instructions on the diagram on how to do this. When you've made the changes, save it as a new name and in a new location.
    Attachments:
    time_to_seconds.vi ‏17 KB

  • How to convert  Timestamp  into exact Date and Time(FM)

    Hi Gurus,
    could anyone tel me  ,
    e.g:20.11.2008:11:23:54am
    How to convert Time stamp  into exact Date and Time

    Hi,
    Following is one way of doing it
    Timestamp timeStamp = new Timestamp(Calendar.getInstance().getTimeInMillis());
              System.out.println(timeStamp);
              SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
              System.out.println(dateFormat.format(timeStamp));
              SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
              System.out.println(timeFormat.format(timeStamp));
    Output
    2008-11-20 11:59:35.693 -> Timestamp
    11/20/2008
    11:59:35
    Regards
    Ayyapparaj

  • Converting timestamp from local time to UTC

    Is there a smooth way to convert a timestamp containing local time to UTC time?
    The statement:
    CONVERT TIME STAMP time_stamp TIME ZONE tz
    INTO [DATE dat] [TIME tim]
    [DAYLIGHT SAVING TIME dst].
    Consideres time_tamp to be UTC time and then tries to convert it to the time zone specified in tz. What I would like to have done is the opposite, to have time_stamp represent the local time and then convert it back to UTC.
    TIA!
    /Armin

    Hi Armin.
    Just turn your statement and you will be fine
    DATA: date TYPE sydatum VALUE '20070525',
          time TYPE syuzeit VALUE '173030',
          cet  TYPE tzonref-tzone VALUE 'CET',
          utc  TYPE tzonref-tzone VALUE 'UTC',
          tstp TYPE timestamp.
    CONVERT DATE date TIME time INTO TIME STAMP tstp TIME ZONE cet .
    The output will be 15:30:30 at 25th of May 2007.
    I used CET as example, just use the timezone your date is representing. The result is formatted as UTC.
    Actually if you only have the timestamp, for this solution you have to convert it into date/time first.
    Use
    CONVERT TIME STAMP tstp TIME ZONE utc INTO DATE date TIME time.
    to do so.
    Regards,
    Timo.

  • Function to convert timestamps into milliseconds

    Hi,
    Does SAP have a function module which can read in a date/timestamp and output that time in milliseconds (a long integer starting from 1st January 1970)?
    Many thanks in advance,
    Peter

    try:
    PARAMETERS:d2 TYPE sy-datum DEFAULT sy-datum,
               d1 TYPE sy-datum default '19700101'.
    data sec_day TYPE i . "ms per day
    DATA : d TYPE i.
    DATA result TYPE f.
    DATA rp(16) type p decimals 0.
    AT SELECTION-SCREEN ON d2.
      IF d2 LE d1.
        MESSAGE e001(00) WITH 'date must be greater than 1970/01/01'.
      ENDIF.
    START-OF-SELECTION.
      sec_day = 24 * 60 * 60 * 1000.
      d = d2 - d1.
      rp = result = d * sec_day.
      WRITE: / d2, d1, d, / result, rp.
    hope that helps
    Andreas
    Edited by: Andreas Mann on Apr 10, 2008 3:37 PM

  • JSP Issues Converting Timestamps Correctly

    I am pulling a timestamp from a DB2 database that has the date and time. When I pull the timestamp using the toString() function, it only gives me the year, month, and day, and dropping the time.
    I initialize the SQL, and create the connection to the database in the first few lines, then read the date. It is the 4th item I am querying. There is a lot more to the code, but is a bit confusing. I altered it to be a bit more concise just to draw the gist of what I am trying to do.
    The account number (dsrc_acct) is a parameter that is passed into the JSP, and pulls back relevant information:
    String tSql = "select a.entity_id, a.first_name || ' ' || a.last_name, coalesce(c.addr1, '') || coalesce(', ' || c.addr2, '') || coalesce(', ' || c.city, '') || coalesce(', ' || c.state, '') || coalesce(', ' || c.country, '') || coalesce(', ' || c.postal_code, ''), d.txn_timestamp from name a, dsrc_acct b, address c, gem_event d where a.dsrc_acct_id = b.dsrc_acct_id and b.dsrc_acct_id = c.dsrc_acct_id and b.dsrc_acct = '" + request.getParameter("dsrc_acct") + "'";
    int tRowCount = 0;
    Statement dataCmd = null;
    ResultSet conRS = null;
    dataCmd = conn.createStatement();
    conRS = dataCmd.executeQuery(tSql);
    if ((conRS != null) && (conRS.next()))
    out.print ("<table border = '0' width = 1850px>");
    ResultSetMetaData rsmd = conRS.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    Object dbField = null;
    out.print ("<td><p align='right'><b>Transaction Reference Number: </b>" + request.getParameter("dsrc_acct") + "<br><b>Transaction Send Date/Time: </b>");
    dbField = conRS.getObject(4);
    out.print (dbField.toString() + " ");
    out.print ("</p></td></table>");
    Edited by: jjcheng2 on Oct 26, 2009 2:06 PM

    i get this error when i try to compile:
    JSPG0049E: /EventListWC.jsp failed to compile : JSPG0091E: An error occurred at line: 114 in the file: /EventListWC.jspJSPG0093E: Generated servlet error from file: /EventListWC.jsp C:\progra~1\IBM\Entity_Resolution\was_ee\profiles\DefaultProfile\temp\DefaultNode\server1\ibm-db2-eas-visualizer\eas-visualizer-client.war\_EventListWC.java:137: cannot resolve symbolsymbol : class SimpleDateFormat location: class com.ibm._jsp._EventListWC SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm:ss"); ^JSPG0091E: An error occurred at line: 114 in the file: /EventListWC.jspJSPG0093E: Generated servlet error from file: /EventListWC.jsp C:\progra~1\IBM\Entity_Resolution\was_ee\profiles\DefaultProfile\temp\DefaultNode\server1\ibm-db2-eas-visualizer\eas-visualizer-client.war\_EventListWC.java:137: cannot resolve symbolsymbol : class SimpleDateFormat location: class com.ibm._jsp._EventListWC SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm:ss"); ^2 errors
    Line 114 is when I initialize the SimpeDateFormat.
    I m not quite sure what a SQL Injection vulnerability is.

  • What is the most efficient way to convert TIMESTAMP to BIGDATETIME?

    I'll probably fumble my way into a solution here (because I have none at the moment) but hoping someone chimes
    in with their favorite way to do this.
    Thanks,
    Michael

    Hello,
    I have a couple of ways to do it:
    CREATE INPUT WINDOW INWINDOW SCHEMA (
    C_Integer integer,
    C_Bigdatetime bigdatetime,
    C_Timestamp timestamp,
    C_Date date,
    C_Long long,
    C_String string,
    C_Money2 money(2),
    C_Money7 money(7),
    C_Binary binary,
    C_Float float)
    PRIMARY KEY ( C_Integer ) ;
    CREATE OUTPUT WINDOW OUTWINDOW SCHEMA (
    Column1 integer ,
    Column2 bigdatetime ,
    Column3 bigdatetime ) PRIMARY KEY ( Column1 ) AS
    SELECT
      IW.C_Integer as Column1,
      cast(bigdatetime,IW.C_Timestamp) as Column2,
      to_bigdatetime(to_long(IW.C_Timestamp)*1000) as Column3 FROM INWINDOW IW ;
    You can test it with esp_subscribe:
    %ESP_HOME%\bin\esp_subscribe -c studio:studio -p localhost:9786/default/p6 -s INWINDOW,OUTWINDOW
    <INWINDOW ESP_OPS="i"  C_Integer="500" C_Bigdatetime="2014-05-10 04:10:26.609123" C_Timestamp="2014-05-10 04:10:26.609" C_Date="1970-01-01 19:12:12" C_Long="76" C_String="string" C_Money2="2.22" C_Money7="7.7777777" C_Binary="42696E6172792064617461" C_Float="3.141590"/>
    <OUTWINDOW ESP_OPS="i"  Column1="500" Column2="2014-05-10 04:10:26.609000" Column3="2014-05-10 04:10:26.609000"/>
    Thanks,
      Neal

  • Convert TimeStamp?

    Hi Guys,
                  Can anybody tell me how to convert Time Stamp Filed into Time Format?
                I donnot know what is Time Stamp Field?Can anybody explain me and tell how to convert?
    Thanks,
    Gopi.

    Hi,
    Please try this FM RKE_TIMESTAMP_CONVERT_OUTPUT (Convert GMT to local time/date).
      move COEP-TIMESTMP to timestmp.
      CALL FUNCTION 'RKE_TIMESTAMP_CONVERT_OUTPUT'
           EXPORTING i_dayst    = sy-dayst
                     i_tzone    = sy-tzone
                     i_timestmp = timestmp
           IMPORTING e_date     = wa_date
                     e_time     = wa_time.
      write: / wa_date, wa_time.
    Regards,
    Ferry Lianto

  • Converting TimeStamp to usable date

    I have been using this script, which seems to be all over the web, but keep getting a different date to what is in my database:
        <?php do { ?>
          <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 don't understand what the ORDER of the variables in $orgdate relates to? I have tried them in different orders which has variable effects, so this must be the key I guess?
    The two entries SHOULD display:
    January 8th, 2010        and      June 15th, 2010
    But what I get is:
    December 1st, 2009    and    December 6th, 2009
    I keep seeing January = 1st and June = 6th, so presumably I am getting close???
    I am sure it is something obvious, but can't find it.

    colinwalton wrote:
    Hi, in my effort to try to understand php more, can you possibly explain what this part " -> " of the script means please:
    It's the operator used to access the methods or properties of an object.
    DateTime() is a class, which is why it uses the new keyword. format() is one of the class's methods. There is an old-fashioned procedural equivalent, but it's recommended to use the object-oriented approach instead (http://docs.php.net/manual/en/datetime.format.php).
    Time for you to start learning about classes and objects in PHP 5: http://docs.php.net/manual/en/language.oop5.php. There's a lot to absorb in that section. You don't need to learn it all, but it's useful to know how to use classes and objects. Most new features in PHP use objects, so it's an important subject.

  • Convert timestamp to integer

    hello,
    is it possible and how
    thanks for information
    @rosagio

    Never mind - it is still a number just displayed in scientific notation.
    If you want it displayed "normally" set »numwidth« beforehand:
    SQL>  set numwidth 25
    SQL>  select to_number(to_char(systimestamp,'rrrrmmddhh24missff9')) dt from dual
                           DT
      20090210161723487228000
    1 row selected.

  • Is there a way to view timestamps in DIAdem with a higher precision than 100 microseconds?

    I understand DIAdem has limitations on viewing timestamps due to DateTime values being defined as a double value and that this results in 100 us resolution.  Is there any way to get around this?  I am logging time critical data with timestamps from an IEEE 1588 clock source and it is necessary to have higher resolution.  Perhaps I could convert timestamp to a double before logging but then would have to convert it back in Diadem somehow...
    Thanks,
    Ben

    As you said, DIAdem can only display up to 4 decimal positions on a timestamp. Timestamps in DIAdem are recorded as the number of seconds since 01/01/0000 00:00:00.0000. To achieve a higher precision, it would be necessary to use a relative timestamp. Many timestamps are defined from different references anyway, so it might be possible to import the timestamps as numeric values to maintain their precision. Converting the timestamp prior to importing into DIAdem seems like a viable method of working around the precision limit.
    Steven

Maybe you are looking for

  • Argh. Help Please

    I am running into a problem with graphic symbol behavior. I have 12 instances of a symbol on the stage and I have some animation keyframed out, my problem comes in when I want to keyframe single frames within that graphic symbol. If I take out all of

  • Need help with doing double sided printing!!!

    i have a Epson XP-100 priniter and also MacBook pro laptop i am having serious trouble with doing double side printing can somebody assist me through please thanks

  • How can i execute my project?..

    i am new about java. i have started to write little programs with jbuilder, but i can't have any exe file.. how can i have?... thanks..

  • Could Not Reserver Record(2 tries)

    Hi ! -- Some time when i commit the record, the message appears "Could Not Reserve Record (2 tries), Keep trying" YES NO -- Please tell me about this error. -- May be due to locking of record. --I am using Forms 6i, with 10g. -- My application is mul

  • WF_DEFERRED_QUEUE_M table creation for 11g

    We are trying to create WF_DEFERRED_QUEUE_M after upgrade to 11g from 10g For table WF_DEFERRED_QUEUE_M with compatible parameter 8.0 works to create the table but refuses to create the queue. compatilble parameters 8.1 and 10.0 give "object already