timeout has expired or not
and so act accordingly.
I guess I can use some sort of integer in order to represent it as a unix
timestamp, but I would prefer to use a timestamp.
Any suggestions?
Kind regards
Mensaje original
De: [EMAIL PROTECTED]
Recibido: 10/04/2006 11:51
Para: [EMAIL
timeout has expired or
not and so act accordingly.
I guess I can use some sort of integer in order to represent it as a
unix timestamp, but I would prefer to use a timestamp.
As I said -- to store date/time values, you should NOT use
the TIMESTAMP datatype, cause it isn't supposed to be
used to store
I'm using the MySQL 5.0.15 client to a 5.0 server all 32-bit windows.
It appears that the UNSIGNED_FLAG is being returned for column types of
timestamp.
Checking the flags variable of the MYSQL_FIELD structure indicates that the
following flags are returned:
Field-flags = 1249
NOT_NULL_FLAG
- Original Message -
From: Ferindo Middleton Jr [EMAIL PROTECTED]
To: Ferindo Middleton Jr [EMAIL PROTECTED]
Cc: Hank [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Friday, March 31, 2006 7:30 PM
Subject: Re: TIMESTAMP field not automatically updating last_updated field
Ferindo
Are the other fields in the update statement actually changing the
data? I don't know for sure, but if the data on disk is the same as
the update statement, mysql won't actually update the record, and
therefore might not update the last_updated field also. Just a
thought.
--
MySQL General
true. No Update = No change of timestamp!
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
understand that one concept. I have seen it before If you do
an update on a record but the actually values that you are passing in
the statement are the exact values as were there before, no update to
the timestamp field is made because none of the records values actually
changed
. Just a
thought.
Yes, I understand that one concept. I have seen it before If you
do an update on a record but the actually values that you are passing
in the statement are the exact values as were there before, no update
to the timestamp field is made because none of the records values
usually use the following line in my table declarations:
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
In some tables it automatically updates on subsequent updates to the
table and in others it will not. The purpose here is to have the
last_updated field automatically append
usually use the following line in my table declarations:
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
In some tables it automatically updates on subsequent updates to the
table and in others it will not. The purpose here is to have the
last_updated field automatically append
are you having two timestamp fields in a table (ie a created and a
last_updated)?
-j
On Mar 30, 2006, at 5:17 PM, Ferindo Middleton Jr wrote:
I think I've seen this complaint posted before but I ignored but
now I realize that in some of my db tables' last_updated field the
value
jonathan wrote:
are you having two timestamp fields in a table (ie a created and a
last_updated)?
-j
On Mar 30, 2006, at 5:17 PM, Ferindo Middleton Jr wrote:
I think I've seen this complaint posted before but I ignored but now
I realize that in some of my db tables' last_updated field
with two
timestamp values (#1293 - Incorrect table definition; there can be
only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON
UPDATE clause).
If I can have only one timestamp in the table, what is the ideal way
to do this?
thanks,
jon
--
MySQL General Mailing List
For list
You can make the first timestamp without autoupdating and a default value
with no importance... and the second with
DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
When you insert a new row.. .you'll use:
Asuming the table has columns: col1, ., colN, col_timestamp1,
col_timestamp2
Hi All,
Today, I encountered problem when trying to insert '2006-03-26 03:00:00' value
into timestamp column:
CREATE TABLE `test` (
`a` timestamp
) ENGINE = InnoDB DEFAULT CHARSET = latin1 COLLATE = latin1_german1_ci;
INSERT INTO test VALUES ('2006-03-26 03:00:00' );
Server response was:
ERROR
: Ricardas.S [mailto:[EMAIL PROTECTED]
Sent: 21 March 2006 14:31
To: [EMAIL PROTECTED]
Subject: Re: Timestamp problem in mysql5.0.18
Yes, I think you are right, it should be the main reason of
insert failure.
Thank you for good idea.
Ricka
- Original Message -
From: Jason Teagle [EMAIL
definition the default attributes are (ON
UPDATE CURRENT_TIMESTAMP). Reading the manual my understanding is
this is saying that the auto timestamp update feature is active. The
manual does not say what the trigger is to make the timestamp in the
row to be bumped to the current timestamp. I
Dear All,
First of all, I would like to thank to Josh and Peter Brawley for their kind
help on previous issue.
Here is another Issue:
There are many tables that have timestamp field with 8 char (mmdd). I use
this format all over our website and to create various reports
Dear All,
First of all, I would like to thank to Josh and Peter Brawley for their kind
help on previous issue.
Here is another Issue:
There are many tables that have timestamp field with 8 char (mmdd). I use
this format all over our website and to create various reports
help on previous issue.
Here is another Issue:
There are many tables that have timestamp field
with 8 char (mmdd). I use this format all over
our website and to create various reports. Below is
static php code that I used numerous places:
?
$year=substr($date, 0, 4
--- Yesmin Patwary [EMAIL PROTECTED] wrote:
Dear All,
First of all, I would like to thank to Josh and
Peter Brawley for their kind help on previous issue.
Here is another Issue:
There are many tables that have timestamp field
with 8 char (mmdd). I use this format
In my mysql 4.4 table definition the default attributes are (ON
UPDATE CURRENT_TIMESTAMP). Reading the manual my understanding is
this is saying that the auto timestamp update feature is active. The
manual does not say what the trigger is to make the timestamp in the
row to be bumped
fbsd_user [EMAIL PROTECTED] wrote on 03/13/2006 01:10:17 PM:
In my mysql 4.4 table definition the default attributes are (ON
UPDATE CURRENT_TIMESTAMP). Reading the manual my understanding is
this is saying that the auto timestamp update feature is active. The
manual does not say what
Hi All,
I have recently noticed in the MySQL 5.0 documentation in section 11.3.1.
The DATETIME, DATE, and TIMESTAMP Types, it's mentioned that
TIMESTAMP values cannot be earlier than 1970 or later than 2037. This means
that a date such as '1968-01-01', while legal as a DATETIME or DATE
rtroiana wrote:
Hi All,
I have recently noticed in the MySQL 5.0 documentation in section 11.3.1.
The DATETIME, DATE, and TIMESTAMP Types, it's mentioned that
TIMESTAMP values cannot be earlier than 1970 or later than 2037. This means
that a date such as '1968-01-01', while legal
If you need a broader range of dates, you could use DATETIME instead of
TIMESTAMP: DATETIME can handle the range '1000-01-01 00:00:00' through
'-12-31 23:59:59'. The only big difference is that DATETIME does not
store the fractional part of the seconds, e.g.
milliseconds/microseconds
a separate column to store any values that represent fractions of
seconds.
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
Rhino [EMAIL PROTECTED] wrote on 03/02/2006 01:25:36 PM:
If you need a broader range of dates, you could use DATETIME instead of
TIMESTAMP: DATETIME can
. The different formats are explained here:
http://dev.mysql.com/doc/refman/5.0/en/datetime.html.
--
Rhino
- Original Message -
From: rtroiana [EMAIL PROTECTED]
To: 'Rhino' [EMAIL PROTECTED]
Sent: Thursday, March 02, 2006 1:29 PM
Subject: RE: TimeStamp issue
Thanks for the reply. I'm using
]
To: Rhino
Cc: mysql@lists.mysql.com ; rtroiana
Sent: Thursday, March 02, 2006 1:42
PM
Subject: Re: TimeStamp issue
In fact, no time values in
MySQL are fractional (yet). All times are stored to the nearest second
regardless of which date-time-like storage type you use
Thanks to all of you for replying. I'm using DATETIME instead of TIMESTAMP
now. Although I still haven't find the answer for my second question.
I used to use
CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP as default value for my
TimeStamp column. Is there a way to assign default value
On 3/2/06, rtroiana [EMAIL PROTECTED] wrote:
Thanks to all of you for replying. I'm using DATETIME instead of TIMESTAMP
now. Although I still haven't find the answer for my second question.
I used to use
CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP as default value for my
TimeStamp
Greetings!
I am building a website using MySQL 5.0.18 and PHP 5.1.2.
When I try to insert in a table a timestamp value from php's mktime() I get
the following error:
1292: Incorrect datetime value: '1139776424' for column 'access_date' at row
1
The sql for the table is:
CREATE TABLE `members_acs
pedro mpa wrote:
Greetings!
I am building a website using MySQL 5.0.18 and PHP 5.1.2.
When I try to insert in a table a timestamp value from php's mktime() I get
the following error:
1292: Incorrect datetime value: '1139776424' for column 'access_date' at row
1
The sql for the table is:
CREATE
hi!
I'm using mysql 4.1 and I have a problem with a TIMESTAMP column (with all
of them actually). I've used them before in mysql 3.x and they worked just
fine. And at first I thought 'they changed something', but in the mysql 4.1
manual it still says
A TIMESTAMP column is useful for recording
Hello.
Have you checked if the timestamp column is set with CURRENT_TIMESTAMP as
the default value?
If it doesnt, you can try this:
ALTER TABLE tbl MODIFY column TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP;
And mysql will fill the column with current timestamp
is possible to get UNIX timestamp with microseconds
when i try the following it just give 10 digits
mysqlSELECT unix_timestamp('20051114095641'+ INTERVAL 0 HOUR) as ts;
output :
1131933401 --- 10 digits
any tips?
tia!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com
is it possible to get the the given (unix)timestamp in milliseconds
since the epoch?
tia!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi Ryan,
On Wed, 2005-11-16 at 19:16 +0800, Ryan Escarez wrote:
is it possible to get the the given (unix)timestamp in milliseconds
since the epoch?
No, it is not possible. However this is on the roadmap.
This is also reported as Bug #8523:
http://bugs.mysql.com/bug.php?id=8523
Regards
Hello.
According to the manual Unix timestamp (seconds since '1970-01-01
00:00:00', so, in my opinion UNIX_TIMESTAMP is not designed for
obtaining microseconds. Have a look here, if you haven't done this
yet:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Ryan
Ryan,
Try to use this date functions.
* DATE_ADD(date,INTERVAL expr type) , DATE_SUB(date,INTERVAL expr type)
These functions perform date arithmetic. date is a DATETIME or DATE value
specifying the starting date. expr is an expression specifying the interval
value to be added or
Hi all, I have a field in a mysql database v4.0.18 that contains a
linux timestamp. I have been googleing for a solution that would
return to me all the entries where the timestamp falls on, say a
wednesday, or between 2pm to 3pm. I am led to believe that it is
possible, but I have found
On 27/09/2005, Dotan Cohen wrote:
Hi all, I have a field in a mysql database v4.0.18 that contains a
linux timestamp. I have been googleing for a solution that would
return to me all the entries where the timestamp falls on, say a
wednesday, or between 2pm to 3pm.
SET @uts := UNIX_TIMESTAMP
Dotan Cohen wrote:
Hi all, I have a field in a mysql database v4.0.18 that contains a
linux timestamp. I have been googleing for a solution that would
return to me all the entries where the timestamp falls on, say a
wednesday, or between 2pm to 3pm. I am led to believe that it is
possible, but I
Dotan Cohen wrote:
Hi all, I have a field in a mysql database v4.0.18 that contains a
linux timestamp. I have been googleing for a solution that would
return to me all the entries where the timestamp falls on, say a
wednesday, or between 2pm to 3pm. I am led to believe that it is
possible
On 9/27/05, Nigel Wood [EMAIL PROTECTED] wrote:
Dotan Cohen wrote:
Hi all, I have a field in a mysql database v4.0.18 that contains a
linux timestamp. I have been googleing for a solution that would
return to me all the entries where the timestamp falls on, say a
wednesday, or between 2pm
Hi,
I have a row in myslq database called time and is just a simple timestamp
column
When I echo it out
echo $row['time'];
echo $row['content'];
I get the following
2005-08-30 13:50.05 this is the text content
Now I am not worried about the time but I would like to know how to
(i) sort
2005-08-30 13:50.05 this is the text content
(i) sort the returned rows in order (latest first)
http://dev.mysql.com/doc/mysql/en/sorting-rows.html
(ii) be able to extract the individual parts of the date and display them in
UK format (ddmm)
[EMAIL PROTECTED] wrote:
Hi,
I have a row in mysql database called time and is just a simple timestamp
column
When I echo it out
echo $row['time'];
echo $row['content'];
I get the following
2005-08-30 13:50.05 this is the text content
Now I am not worried about the time but I would like
Hunter Peress wrote:
Yes theres all this talk about timestamp returning different results in
4.1 vs. 4.0
but i took the MYI and MYD and frm files from a winnt running 4.0.14
and transferred to a 4.1.11-Debian_4-log
and all the timestamp fields are NULL
it seems all the other data is fine
the issue was because i was viewing the database through cocoamysql,
which registered the timestamps as null.
stupid me viewing the database through the commandline showed up
fine
---
Hunter Peress
i have this query:
SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline,
interval 1 hour) = now() GROUP BY filename ORDER BY score DESC
unfortunately for other reasons i had to change `dateline` to unix timestamp so this query is no longer able to run as intended. can anyone help
Sebastian [EMAIL PROTECTED] wrote on 08/15/2005 03:51:05 PM:
i have this query:
SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline,
interval 1 hour) = now() GROUP BY filename ORDER BY score DESC
unfortunately for other reasons i had to change `dateline` to unix
timestamp so
(dateline,
interval 1 hour) = now() GROUP BY filename ORDER BY score DESC
unfortunately for other reasons i had to change `dateline` to unix
timestamp so this query is no longer able to run as intended. can
anyone help with a work around?
btw, i am using php to run queries if that helps find
Sebastian [EMAIL PROTECTED] writes:
i have this query:
SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline,
interval 1 hour) = now() GROUP BY filename ORDER BY score DESC
unfortunately for other reasons i had to change `dateline` to unix
timestamp so this query is no longer
Scott Gifford wrote:
SELECT COUNT(*) AS score FROM downloads
WHERE dateline + 3600 = UNIX_TIMESTAMP()
GROUP BY filename ORDER BY score DESC
It would be better with
WHERE dateline = UNIX_TIMESTAMP() - 3600
so that it can use an index on dateline.
--
Keith Ivey [EMAIL
Keith Ivey [EMAIL PROTECTED] writes:
Scott Gifford wrote:
SELECT COUNT(*) AS score FROM downloads WHERE dateline +
3600 = UNIX_TIMESTAMP() GROUP BY filename ORDER BY score DESC
It would be better with
WHERE dateline = UNIX_TIMESTAMP() - 3600
so that it can use an index
Sebastian wrote:
i have this query:
SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline,
interval 1 hour) = now() GROUP BY filename ORDER BY score DESC
unfortunately for other reasons i had to change `dateline` to unix
timestamp so this query is no longer able to run
Yes theres all this talk about timestamp returning different results
in 4.1 vs. 4.0
but i took the MYI and MYD and frm files from a winnt running 4.0.14
and transferred to a 4.1.11-Debian_4-log
and all the timestamp fields are NULL
it seems all the other data is fine. Any ideas? i suppose
Hi All,
I seem to be having a problem with the resolution using the timestamp
function. I am accessing the database snort on an ACID/SNORT/MySQL
installation utilizing a collection of shell scripts that are run as
cron jobs and function as a bot adding and removing firewall rules
(iptables
I have the following part in a schema
describe feeds
.
| pubdate | timestamp| YES | | CURRENT_TIMESTAMP | |
show create table feeds;
`pubdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
when i make an
INSERT INTO feeds
(0.00 sec)
If you're trying to add seconds onto a timestamp, you're probably
looking for something like:
SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(NOW()) + 1*RAND());
-Original Message-
From: Antonio Gulli [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 8:31 AM
To: mysql
Hi all,
I have a very strange problem with mysql-4.0.22
running on a big endian processor platform.When the
timestamp gets updated as '2005-01-01 23:00:00', it
actually seems to be converted internally as
2005010423.Similarly '2005-01-02 23:00:00' is
'2005010523'.
The problem is that let
Hello.
There were several bugs related to timestamp
at 4.0.22 and later. Does the problem remains
on 4.1.12 (4.0.24)?
manasvini nandakumar [EMAIL PROTECTED] wrote:
Hi all,
I have a very strange problem with mysql-4.0.22
running on a big endian processor platform.When
You can have any number of timestamp columns, but only one of them can
be set to autoupdate. As of 4.1 you are not limited to this being the
1st one in the table and CURRENT_TIMESTAMP, CURRENT_TIMESTAMP(), or
NOW() can be used in the DEFAULT. Read
http://dev.mysql.com/doc/mysql/en/timestamp
On 6/9/05, Martijn Tonies wrote:
http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html
Absolutely brilliant document *g* ...
So now, it makes a difference if it's the first TIMESTAMP column,
if it's running in MaxDB mode, if it has a defaulf of NULL (which will
be silently changed
http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html
Absolutely brilliant document *g* ...
So now, it makes a difference if it's the first TIMESTAMP column,
if it's running in MaxDB mode, if it has a defaulf of NULL (which will
be silently changed), if it has no default, a default
Hi,
We would like to upgrade our current installation of Mysql 4.0.x to 4.1 to be
able to switch fastly to the MySQL Cluster Solution.
The problem is, that we were using the TIMESTAMP type quite heavily in the
SELECTS, and we splitted the result using for example,
substring in php, so we
Hi,
You have two way to set two default timestamp columns.
FIRST :
just use a variable :
mysql select @t:=current_timestamp;
+---+
| @t:=current_timestamp |
+---+
| 2005-05-19 08:58:56 |
+---+
1 row in set (0.01
this:
CREATE TABLE bookmark (
bookmark_id INTEGER NOT NULL AUTO_INCREMENT,
bookmarkname VARCHAR (80) NOT NULL,
url VARCHAR (150) NOT NULL,
folder_id INTEGER NOT NULL,
last_scanned TIMESTAMP NOT NULL,
PRIMARY KEY (bookmark_id),
FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE CASCADE
Hi,
look at default initialised to current_timestamp. you ca see also on update :
http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html
Mathias
Selon Lieven De Keyzer [EMAIL PROTECTED]:
I 'm writing a webapplication in Java that allows users to store bookmarks.
The system scans these pages
Yes, that's what I'm talking about. Only one column can have this
current_timestamp as default statement.
From: [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 19:57:43 +0200
Hi,
look at default
about
changed bookmarks. The bookmark table provisionally looks like this:
CREATE TABLE bookmark (
bookmark_id INTEGER NOT NULL AUTO_INCREMENT,
bookmarkname VARCHAR (80) NOT NULL,
url VARCHAR (150) NOT NULL,
folder_id INTEGER NOT NULL,
last_scanned TIMESTAMP NOT NULL,
PRIMARY
From: [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 15:05:17 -0400
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005
01:44:31 PM:
I 'm writing a webapplication in Java that allows users
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005
03:21:02 PM:
From: [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 15:05:17 -0400
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05
Corporation - Spruce Pine
I am not sure which Java package you are using (or I would look at its
documentation to make sure of what I am about to say) but it makes sense
to me that an object of the Java timestamp class would map to a MySQL
datetime field. What happens when you try
From: Mark Matthews [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 14:58:41 -0500
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
[EMAIL PROTECTED] wrote:
Lieven De Keyzer [EMAIL
Lieven De Keyzer wrote:
But how do I initialize the 2 datetime fields? With no DEFAULT, their
values are -00-00 00:00:00. Just what I wanted to avoid with TIMESTAMP
Set their value to NOW() if you want the current date/time.
-Simon
--
MySQL General Mailing List
For list archives: http
KEY (bookmark_id),
- FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE
CASCADE) TYPE = InnoDB;
ERROR 1067 (42000): Invalid default value for 'last_scanned'
From: Simon Garner [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Thu, 19 May
Lieven De Keyzer wrote:
mysql CREATE TABLE bookmark (
- bookmark_id INTEGER NOT NULL AUTO_INCREMENT,
- bookmarkname VARCHAR (80) NOT NULL,
- url VARCHAR (150) NOT NULL,
- folder_id INTEGER NOT NULL,
- last_scanned DATETIME DEFAULT NOW(),
- last_notified DATETIME
result has the correct
year (this seems actually to be coincidence and nothing more) but I am not sure
exactly what MySQL did for casting. The query produces no errors or warnings.
I *think* the incorrect result is an internal timestamp format but with the
wrong data. Is there a part of the manual
is an internal timestamp format but
with the
wrong data. Is there a part of the manual that I missed which explains
this
unexpected behavior?
AVG(col) v FROM_UNIXTIME(AVG(UNIX_TIMESTAMP(col)))
20050258324839 v 2005-03-24 02:05:11
James Nobis
Web Developer
Academic Superstore
223 W. Anderson
timestamp format but
with the
wrong data. Is there a part of the manual that I missed which explains
this
unexpected behavior?
AVG(col) v FROM_UNIXTIME(AVG(UNIX_TIMESTAMP(col)))
20050258324839 v 2005-03-24 02:05:11
James Nobis
Web Developer
Academic Superstore
223 W. Anderson Ln. Suite A110, Austin, TX
not sure
exactly what MySQL did for casting. The query produces no errors
orwarnings.
I *think* the incorrect result is an internal timestamp format but
with the
wrong data. Is there a part of the manual that I missed which
explains
this
unexpected behavior?
AVG(col) v
Hello,
Am I gaining anything by using a timestamp instead of using dateTime and
calling now(), for example, increased performance, better indexing, etc.
I guess another way to ask this is does the MySQL internals handle a
timestamp more efficiently than a dateTime.
Thanks
Michael
--
MySQL
IMO, dateTime doesn't parse now() the same way that timeStamp does. If you
use now() in a dateTime field, I have found that it doesn't always write the
time to the record, while using now() with the timestamp always does.
As far as your other questions, the indexing and increased performance, I
From: DePhillips, Michael P
Am I gaining anything by using a timestamp instead of using dateTime and
calling now(), for example, increased performance, better indexing, etc.
I guess another way to ask this is does the MySQL internals handle a
timestamp more efficiently than a dateTime.
I
Hi,
i'm using the 4.1.10 version of mysql.
If I do :
select max(timestamp + 0 ) as timestamp from news;
++
| timestamp |
++
| 20050314194920 |
++
so i got the full timestamp(14), but if I do :
select max(timestamp) + 0 as timestamp from news
Mister Jack wrote:
Hi,
i'm using the 4.1.10 version of mysql.
If I do :
select max(timestamp + 0 ) as timestamp from news;
++
| timestamp |
++
| 20050314194920 |
++
so i got the full timestamp(14), but if I do :
select max(timestamp) + 0
It returns :
select max(timestamp) as timestamp from news;
+-+
| timestamp |
+-+
| 2005-03-14 19:49:20 |
+-+
and also :
select timestamp as timestamp from news limit 1;
+-+
| timestamp
Mister Jack wrote:
It returns :
select max(timestamp) as timestamp from news;
+-+
| timestamp |
+-+
| 2005-03-14 19:49:20 |
+-+
The string shown above converted into a number is 2005.
( Unless you think ist should be 1988
From the manual :
MIN() and MAX() may take a string argument; in such cases they return
the minimum or maximum string value.
so I understand that for a timestamp column, values are converted and
then compared as strings, then the function return a string, so adding
+ 0 convert it to a number
Hi, there,
I have MySQL 4.1.10. I need to add a timestamp column to an existing
table. I am having a problem of setting the newly added column to be the
current time.
This is what I did:
CREATE TABLE try (id INTEGER); INSERT INTO try VALUES(1), (2), (3);
ALTER TABLE try ADD timestamp
I'd suggest not using the keyword timestamp as a column name. I'd
suggest using ts or tstamp or something like that.
To update the records to the current timestamp:
update try set tstamp=null;
should do it. I don't know why the default isn't working, though.
On Mon, 28 Feb 2005 10:05
Hi!
Am Mo, den 28.02.2005 schrieb Hank um 17:09: [top-posting reordered!]
On Mon, 28 Feb 2005 10:05:32 -0500, Zhe Wang [EMAIL PROTECTED] wrote:
Hi, there,
I have MySQL 4.1.10. I need to add a timestamp column to an existing
table. I am having a problem of setting the newly added column
, 28 Feb 2005 10:05:32 -0500, Zhe Wang [EMAIL PROTECTED] wrote:
Hi, there,
I have MySQL 4.1.10. I need to add a timestamp column to an existing
table. I am having a problem of setting the newly added column to
be the
current time.
This is what I did:
CREATE TABLE try (id INTEGER
I have been trying to figure out a way to filter a date out of
timestamp to no success. How do I filter out specific critieria that
I need using now()?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
[snip]
I have been trying to figure out a way to filter a date out of
timestamp to no success. How do I filter out specific critieria that
I need using now()?
[/snip]
http://www.mysql.com/substring
WHERE now() = substring(dateTimeColumnName, 1, 8)
should get it
--
MySQL General Mailing List
Thanks to both of you, here is my string:
select * from test where date(now())=substring(date,1,10);
:)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi all
i would like to create a Timestamp upon initial creation of a record. I
expected this could be done using now() in my INSERT statement but obv. the
related field gets actualised each time a record is updated. Unfortunately
that's not what i like - i would like to have the timestamp set
i would like to create a Timestamp upon initial creation of a record. I
expected this could be done using now() in my INSERT statement but obv.
the
related field gets actualised each time a record is updated. Unfortunately
that's not what i like - i would like to have the timestamp set just
101 - 200 of 548 matches
Mail list logo