Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2006, 02:18 PM
Registered User
 
Join Date: Feb 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help Problem!!!

hi i wonder if you can help i`m following wroxbeginningSQL and i`m using mySQL Query Browser version 1.1.20 when i enter data ie: date of birth the book enters the date as 1977-01-09 now i`m english in england my computer is english not american i want to enter the date as 01-09-1977 so i can understand it but mysql wont allow me to put the date format that i want, i have looked through the options but no luck also i thought that when i installed mysql it would regionalise the installation automatically any help would be great if you know what i`m on about

thanks

 
Old April 25th, 2006, 05:41 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Has far as I know the date format isn't flexible.

There is however nothing stopping you from moving the value of the date around to record and show them the way you want.

have a look there:
http://uk2.php.net/substr

$date="1977-01-09";
$date=substr($date,5,5)."-".substr($date,0,4);

might not be totaly exact but thats the idea...

I hope you find that usefull.
 
Old April 25th, 2006, 11:38 PM
Authorized User
 
Join Date: Mar 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Atleast you can retrieve the date in your desired format. Like....

mysql> select bdate,date_format(bdate,'%d-%c-%Y') from birth;
+------------+-------------------------------+
| bdate | date_format(bdate,'%d-%c-%Y') |
+------------+-------------------------------+
| 1976-09-11 | 11-9-1976 |
| 1976-01-14 | 14-1-1976 |
| 1976-10-24 | 24-10-1976 |
| 1987-02-18 | 18-2-1987 |
| 2006-03-27 | 27-3-2006 |
| 2006-03-27 | 27-3-2006 |
| 2006-03-19 | 19-3-2006 |
| 2006-03-20 | 20-3-2006 |
| 2006-03-22 | 22-3-2006 |
| 2006-03-30 | 30-3-2006 |
| 2006-03-30 | 30-3-2006 |
| 2006-03-30 | 30-3-2006 |
| 0000-00-00 | 00-0-0000 |
| 2006-04-11 | 11-4-2006 |
+------------+-------------------------------+
14 rows in set (0.00 sec)

Regards
Milind










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.