Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default timestamp

    Hi,
    I have 2 timestamp. How can I retrieve hours, minutes and secont between
    them?

    --

    EniGMistA


    EniGMistA Guest

  2. Similar Questions and Discussions

    1. backward timestamp
      I am using simple record, but it is not recording properly, playback is showing still video, audio is running, at last moments video runs very fast...
    2. CF DST log files timestamp
      I know there is a KB article on this, but the link from the DST KB article doesn't work and searching for it comes up with nothing. Does anyone...
    3. Querying a timestamp
      Hello all, Having a problem querying a timestamp for a date. This is my query: SELECT * FROM accessLog WHERE td = '03/05/05' In the database, td...
    4. int4 -> unix timestamp -> sql timestamp; abstime?
      Hello, what is the opposite of cast(extract('epoch' from now()) as int)? The only thing I found that works is cast(cast(... as abstime) as...
    5. [PHP] timestamp
      This is what I'm using so far. But I need to put in a time stamp to calculate if the visitor is new. I want to use the IP so if the ip saved in MySQL...
  3. #2

    Default Re: timestamp

    EniGMistA wrote:
    > I have 2 timestamp. How can I retrieve hours, minutes and secont
    > between them?
    Hi,
    you mean UNIX timestamp or MySQL timestamp?

    In the first case look [url]http://www.php.net/date[/url] , in the second case
    loot [url]http://www.php.net/substr[/url]

    --
    I am what I am, I do what I can
    L'uomo, conscio di sbagliare, persevera.
    Setec Astronomy Guest

  4. #3

    Default Re: timestamp

    > In the first case look [url]http://www.php.net/date[/url] , in the second case
    > loot [url]http://www.php.net/substr[/url]
    I know PHP site. I think that this is a math problem :)

    --

    EniGMistA


    EniGMistA Guest

  5. #4

    Default Re: timestamp

    EniGMistA wrote:
    > Hi,
    > I have 2 timestamp. How can I retrieve hours, minutes and secont between
    > them?
    >
    something like:

    $totseconds=$t2-$t1;
    $sconds=$totseconds % 60;
    $hours=(integer)($totseconds/3600);
    $minutes=(integer(($totseconds % 3600)/60);

    hth

    C.
    Colin McKinnon Guest

  6. #5

    Default Re: timestamp

    > $totseconds=$t2-$t1;
    > $sconds=$totseconds % 60;
    > $hours=(integer)($totseconds/3600);
    > $minutes=(integer(($totseconds % 3600)/60);
    Thanks. Olny a mistake:
    $minutes=(integer(($totseconds % 3600)/60); >
    $minutes=(integer)(($totseconds % 3600)/60);

    --

    EniGMistA


    EniGMistA Guest

  7. #6

    Default Re: timestamp

    Hello - I followed this thread and checked the links provided, but a solution
    is not obvious to me. I have a results page with this PHP code that displays
    the raw timestamp data <td><?php echo $row_BookOrderList['OrderDate'];
    ?>&amp;nbsp; </td> I'd like it do display as mm-dd-yyyy. I've figured out how
    to display the date, but not to convert the contents of a field just for
    display purposes. Any help would be much appreciated. Thanks

    ehowman Guest

  8. #7

    Default Re: timestamp

    ehowman wrote:
    > Hello - I followed this thread and checked the links provided, but a solution
    > is not obvious to me. I have a results page with this PHP code that displays
    > the raw timestamp data <td><?php echo $row_BookOrderList['OrderDate'];
    > ?>&amp;nbsp; </td> I'd like it do display as mm-dd-yyyy. I've figured out how
    > to display the date, but not to convert the contents of a field just for
    > display purposes. Any help would be much appreciated. Thanks
    As Micha suggested, you should use MySQL DATE_FORMAT() to extract the
    date from the database. That way it will be already formatted the way
    you want it.

    In your SQL query, instead of OrderDate, use the following:

    DATE_FORMAT(OrderDate, '%m-%d-%Y')

    If you are using the Simple mode in the Recordset dialog box, click the
    Advanced button. That will display your SQL query fully written out.
    Simply alter "OrderDate" as shown above. That's all there is to it.

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  9. #8

    Default Re: timestamp

    Thank you for the very fast reply, you solved it! I was using the code in the wrong place and was missing a bit of the syntax.

    Thank you for your time and effort.

    Eric
    ehowman Guest

  10. #9

    Default Re: timestamp

    ehowman wrote:
    > Thank you for the very fast reply, you solved it! I was using the code in the wrong place and was missing a bit of the syntax.
    >
    > Thank you for your time and effort.
    Glad to have been of help. The date and time functions in MySQL can be a
    little difficult to get your head around to begin with, but they're very
    useful.

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139