473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FROM_DAYS doesn't take timestamp?

Hi,
I'm using v 3.23.46-nt and the C API.

The manual says under 'Changes in release 3.20.17' that:
Change FROM_DAYS() and WEEKDAY() to also take a full TIMESTAMP or DATETIME as
argument. Before they only took a number of type YYYYMMDD or YYMMDD.


I'm confused since this doesn't seem to be the case.
If I do SELECT from_days(731799); I get today's date. But if I try and
pass a 'timestamp' I get '0000-00-00' e.g.
SELECT from_days(now());

1) Is this a doc bug or am I not passing the 'timestamp' in the right
way?
2) I'm trying to get/set the date and time in a datetime column without
having to use formatted date strings ('yyyy-mm'dd hh:mm:ss'). I hoped to
use a long long integer to store the datetime as the number of seconds
(or any smaller unit) since the epoch. If from_days()/to_days() aren't
the functions to do this are there similar functions in mysql which
handle the time as well as the date? I don't want to use from_unixtime()
as I think the dates screw up in 2038.

Thanks,
Andy.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1535

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a...
22
by: Mal Ball | last post by:
I hope I have the right forum for this question. I have an existing Windows application which uses a SQL Server database and stored procedures. I am now developing a web application to use the same...
5
by: Brett Romero | last post by:
I have this in an app.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <trace autoflush="true" indentsize="2"> <listeners> <add name="myListener"...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
8
by: kanwal | last post by:
Hi, I have millions of records in my xxxxx table in mysql. And I have a column of time in which I have stored the timestamp using php time() function. Now I wanna write an SQL query to fetch...
3
by: Soulless | last post by:
Hi, I am accessing a stored proc from within C# and the result of the proc populate a dataset. The problem is, the proc returns an int and a timestamp. I do not need the timestamp and wish...
1
by: jamied66 | last post by:
I'm using a PHP script to upload a file into a pretty simple database. The file that is uploaded doesn't have a date field. Uploading the file works fine. I've set the timestamp field using...
5
by: Hemant Shah | last post by:
Folks, How can I convert date/time/timestamp to an integer? According to UDB 8.1 docs that I have, INTEGER('1964-07-20') should return 19640720, but when I run the SQL statement I get...
7
by: up2trouble | last post by:
In mysql, I have a field defined as a time stamp. It is storing value as 0000-00-00 00:00:00. It to store it in seconds. <?PHP $entered = mktime(); echo "<INPUT TYPE='text' NAME='$entered'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.