473,473 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Frmatting date returned from MYSQL

HI all,

How qould I format a date returned from a mysql database in the format of
dd/mm/yyy

Thanks
Robert
Jul 17 '05 #1
6 1729

"joe soap" <me@u.com> wrote in message
news:ge********************@is.co.za...
HI all,

How qould I format a date returned from a mysql database in the format of
dd/mm/yyy

Thanks
Robert


A combination of strtotime() (to get a Julian date from a MySQL date format
string) and date():

http://uk2.php.net/manual/en/function.date.php

I'll leave the exact implementation to you as an exercise...

Garp
Jul 17 '05 #2
HI,

Tank you very much.

It was most helpfull

Robert
"Garp" <ga***@no7.blueyonder.co.uk> wrote in message
news:Zx*******************@news-text.cableinet.net...

"joe soap" <me@u.com> wrote in message
news:ge********************@is.co.za...
HI all,

How qould I format a date returned from a mysql database in the format of dd/mm/yyy

Thanks
Robert
A combination of strtotime() (to get a Julian date from a MySQL date

format string) and date():

http://uk2.php.net/manual/en/function.date.php

I'll leave the exact implementation to you as an exercise...

Garp

Jul 17 '05 #3
In article <ge********************@is.co.za>, joe soap wrote:
HI all,

How qould I format a date returned from a mysql database in the format of
dd/mm/yyy


Have a look at the DATE_FORMAT function in mysql manual

--
Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>
Jul 17 '05 #4
Hi,

Thanks, that might be a better solution.

Robert

"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:2i************@uni-berlin.de...
In article <ge********************@is.co.za>, joe soap wrote:
HI all,

How qould I format a date returned from a mysql database in the format of dd/mm/yyy


Have a look at the DATE_FORMAT function in mysql manual

--
Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>

Jul 17 '05 #5
[top-post fixed]

"joe soap" <me@u.com> wrote in message
news:Td********************@is.co.za...
"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:2i************@uni-berlin.de...
In article <ge********************@is.co.za>, joe soap wrote:
HI all,

How qould I format a date returned from a mysql database in the format of dd/mm/yyy


Have a look at the DATE_FORMAT function in mysql manual

--
Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>

Hi,

Thanks, that might be a better solution.

Robert


I agree. If you don't have to support multiple database engines, at least.

Garp
Jul 17 '05 #6
rb
HI,

I agree. If you don't have to support multiple database engines, at least.

Garp

Well for the time being and this particular app, it is just MYSQL

Robert
Jul 17 '05 #7

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

Similar topics

2
by: Obscurr | last post by:
hi, I fetch a row from an MSSQL db with a field that's of type date. I'm returned i.e. Oct 15 2003 12:00AM. code: $test = mssql_fetch_row($resultmail); echo $test; I want only to get the...
2
by: Ben | last post by:
I would like to use php to query a database and retrieve a unix timestamp. The problem is that mysql is storing the data in the date format and not a timestamp. I am sure that I can amend my...
5
by: Greg | last post by:
I have a page that searches a database by a repairman's name and by a date range. It pulls info by the repairman's name but pulls all info in the database regardless of the date. Below is the code...
0
by: Mike At Spy | last post by:
I am trying to create an order by in a select statement that takes a standard 'date' column in a table and sorts the returned data by the month of that date. Off hand, I tried ORDER BY...
0
by: Andy Jackman | last post by:
Hi, 1) I was investigating the unix_timestamp routine in mysql (version 3.23.46-nt) and for some reason the unix epoch (1-1-1970) was returned with a value of -3600. Then, as you can see, it...
2
by: laredotornado | last post by:
Hello, Using PHP 4, MySQL 4, I am getting a date field $dbh = executeSQL($query); while ($row = mysql_fetch_array($dbh)) { $offer_id = $row; $dep_date = $row; // print out date print...
4
by: jbiggs via AccessMonster.com | last post by:
I am in the process of converting our backend from Access to mySQL. There are 21 tables and all of them except for one exported correctly. Our clients table is giving me problems and I suspect it...
3
by: menzies | last post by:
Hi, I"m new to this forum, but I have been trying all day to install DBD::mysql onto my Intel MacBook. I've read lots of forums pages and none have gotten me to a successful 'make test' or a...
3
by: pedalpete | last post by:
I'm building a calendar site, and am wondering if I've gone wrong in the way I have structured it. Right now, I take the date of each cell, and pass it as a query to mysql and put the response in...
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...
1
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.