473,395 Members | 1,537 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,395 software developers and data experts.

converting to DATE format

106 100+
hi ,
i have a problem in mysql query , im using a calendar to insert a given date into the DB and the column is stored as a DATE when i use the mysql "insert into" the date is not stored its found to be empty , i think some conversion is needed , i tried storing the field as a varchar, it worked for sure but messed up with some other form so i need it to be stored as DATE

any help is greatly appreciated
Aug 23 '10 #1
1 1273
TheServant
1,168 Expert 1GB
Have a look here.

To be more specific, you need to look at: FROM_UNIXTIME() and UNIX_TIMESTAMP().

Edit:: I found this again! It's a great post on different ways to do what you want with pro's and con's.
Aug 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Kit | last post by:
Howdy! I have some dates in a MySQL database that are in a 'Y-m-d' format. Is there a way to have PHP read these dates and convert them to a 'd-M-Y' format?
1
by: Bogdan Zamfir | last post by:
Hi, I use an Access BE, and I need to use an update SQL query to update a datetime field In my locale date format is dd/mm/yy, but in Access SQL date must bhe formatted as mm/dd/yy in order to...
2
by: Brian Candy | last post by:
I am guessing that this must be a common question, but I just can't find a simple solution for it by searching the newsgroups. I have a Text Box with a date in a UK format. The format has been...
3
by: MattB | last post by:
I've hit a snag with an application I wrote because of the differing date formats in different countries. It's a set of pages that make calls to a COM object that I have wrapped in a web...
2
by: Rahul | last post by:
Hey Guys I have a development environment, in which the whole SQL syntax is stored in the Database. So the syntax in the databse column could be "where BirthDate = '12/31/2005' and ID =...
2
by: savigliano | last post by:
hello, i am doing a date comparation and i have reallize that the data i have in my database (general date format) it is causing me problems, and because i donīt need the time data i would like to...
3
by: Jef Driesen | last post by:
How can I convert a date string to a number (e.g. a time_t value or a tm struct)? I know about the strptime function, but then I have to know the format string. And that is a problem. I'm trying...
4
by: gubbachchi | last post by:
Hi, I have an issue regarding the php date format. I choose the date from date-picker which is in the format date('Y-m-d') i.e. 2008-09-12, then I will store this date in the variable $date_id and...
1
by: BulbFresh | last post by:
Hi, Quick one for you, i'm importing a file which has a long date and time format, so once imported i update each date field with the correct format (dd/mm/yyyy). I wrote this in on click of a...
4
by: nikos | last post by:
Hi, I have a table with one of the columns configured to record dates as ('#', 'MM/DD/YYYY'). However, two entries in that column are of format YYYY and MM/YYYY. How can I change only those two...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
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...

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.