473,789 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date storage format

Good day, and Happy New Year!

I'm trying to teach myself some PHP and MySQL and the project that I've
decided to build will be dependent on queries involving comparisons of
dates. I'd like some advice, please, on whether I should -

1. Store the date (2008-01-01) in the MySQL table as a date and compare to
that, or...
2. Create a/ timestamp/s for the date/s in question, store the timestamp and
then compare to that.

If the timestamp is the way to go, should that column be of type "Timestamp"
or will that cause the string to be altered to a MySQL timestamp?

Thank you in advance for any assistance.
Steve E.


Jan 1 '08 #1
0 1229

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

Similar topics

13
1491
by: Bjorn | last post by:
Hi, The Access table "dayoff" contains following dates: 8/4/2004 till 8/14/2004 (in dd-mm-yy format). 'dat1' and 'dat2' contains dates coming from two combo-boxs. When 'dat1' contains "8/4/2004" and 'dat2' contains "8/9/2004", no problem: there are deleted. When 'dat1' contains "8/10/2004" and 'dat2' contains "8/14/2004", no problem either: there are deleted But when 'dat1' contains "8/4/2004" and 'dat2' contains "8/14/2004", only
2
5494
by: yasaswi | last post by:
I have date values in mm/dd/yy format in a text file. How can use the LOAD command or mysqlimport command and load those date values. Currently I just load the date values as text into MySQL tables and manipulate the text in applications. There must be a better way? can I use DATE_FORMAT or something like that? Thanks, Yasaswi
4
1748
by: Bell, Kevin | last post by:
Anyone aware of existing code to turn a date string "8-15-05" into the number 20050815? The dateutil module has a parse method that looks perfect, I downloaded and unzipped it, but could figure out how to install it. I using windows XP and py2.4. Any ideas?
2
5796
by: pradeep | last post by:
hi! i want to know how define a datatype to input date by user and store it.
3
8352
by: mike | last post by:
I am struggling with a problem that should be easy to solve it but has me stumped. I am writing data to a table using ADO and writing the date to this table. I have a calendar control on the form that allows me to choose the date. I also have a procedure on the OnLoad event of the form to set a data variable to NOW(). If I don't want to change this I simply write this variable to the table. The trouble is it insists of switching the...
29
9135
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that has the date(s) stored in it as number of days. An example is: 36,525 represents 01/01/1900. The starting point date is considered to be : 00/00/0000. I have looked thru Help and used Google and have not really found an answer. I know that Leap Years need to be accounted for too. Any...
3
2008
by: news | last post by:
Hello, Can someone help me with this request? 1. Data in my access database have the format "9/10 2005" 2. When I show all dates within an asp page I get the following format "9/10/2005" The format I want to show in my asp page is the following format "9/10-05" !!! Please help!!
3
1815
by: josh3006 | last post by:
Hi there I'm new in DB2, currently i'm into java development The problem that i'm facing is that when i use JSP page to save, the date is correct when i pass(from JSP page) to database, but when i checked inside the database the date stored is different than what i passed or saved into the datbase. Can anyone have idea on this ? If possible, how can i see the server time using DB2 sql command ? i have tried now(),getDate,.. and so on......
9
6372
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various forms which are based on an ODBC-linked tables. In one of the forms, I have a control which shows the date of a date field in my database (storage type=date). The default value for the control is set to '=Date()', the format property is set to...
7
2772
by: mr.nimz | last post by:
hello, this is antenio. recently i've come to a problem. i got a way through it, somehow, still it left me in a curious state, so i'm posting it here, if i can get an answer from some techy, here is my table structure, Name: Table1
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10374
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8998
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5405
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5540
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4078
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.