Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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)

regards,
tomte


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


Comment on Re: Date subroutine
Download Code
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...

      regards,
      tomte


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://615749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2014-11-29 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls