Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Date subroutine

by Tomte (Priest)
on May 16, 2007 at 11:29 UTC ( #615749=note: print w/replies, xml ) Need Help??

in reply to Date subroutine

What did you try? Why don't you read the documentation? Do you think your computer or we here should be able to read your mind?

here is my testrun, everything works as it should - don't just make something up in your head and falter surrender if that failes, read the documentation carefully, experiment with the stuff you read and think:

mysql> create table tstest( ts timestamp not null default now()); Query OK, 0 rows affected (0.03 sec) mysql> insert into tstest values(from_unixtime(114454234)); Query OK, 1 row affected (0.00 sec) mysql> select * from tstest; +---------------------+ | ts | +---------------------+ | 1973-08-17 17:50:34 | +---------------------+ 1 row in set (0.00 sec)

Edit: altered a word to get nearer to the intended meaning...(marked via strike out)


An intellectual is someone whose mind watches itself.
-- Albert Camus

Replies are listed 'Best First'.
Re^2: Date subroutine
by gem555 (Acolyte) on May 17, 2007 at 09:00 UTC
    Timestamp from 1973???? only hour format how can it be inserted

      The value you get by taking the difference of two timestamps is not a timestamp, but an intervall - and that intervall cannot be inserted as just hours - a timestamp is a defined moment in time, not an intervall - as I mentioned here you are simply using the wrong type for that column.

      Please stop spamming the monastery with your rubbish postings - read

      and please above all, read the documentation for the tools you use, namely MySQL in this case, and try to understand the problem you are about to solve before you come up with solutions that aren't likely to work because you don't understand the problem at hand - that seems to be the case here.

      I'm a bit fed up with your behaviour here - posting, multiple times, without content, in the wrong sections, creating new accounts to make the same mistakes again - you are misusing a wonderful place, and with that you are taking away from yourself the opportunity to learn something from all the wonderful, helpful poeple here - kind of sad...


      An intellectual is someone whose mind watches itself.
      -- Albert Camus

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://615749]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2017-02-21 11:19 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (309 votes). Check out past polls.