Re: date format problem

2004-05-03 Thread Egor Egorov
"Matt Tucker" <[EMAIL PROTECTED]> wrote:
> I'm moving a JavaServlet app over from Tomcat on Win2K with a MS SQL 7 DB to Tomcat 
> on Red
> Hat Linux with mySQL. Of course, there's about a hundred queries that use dates and 
> of
> course, they're all in the format mm-dd-. is there a way to format the date 
> column in
> my mysql tables to accept a date in this format or do i really have to go through 
> every
> sql statement and parse the date and rebuild it to be -mm-dd? thanks so much.

If you want to store values in the DATE columns you shoul convert all data to the 
-mm-dd format. Then you can use DATE_FORMAT() function to retrieve data in various 
formats:
http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



date format problem

2004-04-30 Thread Matt Tucker
Hi,

I'm moving a JavaServlet app over from Tomcat on Win2K with a MS SQL 7 DB to Tomcat on 
Red Hat Linux with mySQL. Of course, there's about a hundred queries that use dates 
and of course, they're all in the format mm-dd-. is there a way to format the date 
column in my mysql tables to accept a date in this format or do i really have to go 
through every sql statement and parse the date and rebuild it to be -mm-dd? thanks 
so much. deadline is fast approaching.

Matt Tucker
thoughtbot


Re: Date format problem

2001-06-28 Thread MikeBlezien

On Thu, 28 Jun 2001 21:49:57 +0200, "Sebastiaan J.A. Kamp" <[EMAIL PROTECTED]>
wrote:

if your using perl, heres a real simple way to format your date:

my $date = "28/06/2001";
my($mn,$day,$yr) = split '/',$date;
my $db_date = join('-',$yr,$mn,$day);

# Your output should now be $db_date = 2001-06-28

Hope this helps ;)


>>What programming language are you using?
>>
>>
>>Hi guys, does anyone help me with this simple thing ??
>>
>>I have a date format problem, I need a spanish format please read the
>>following lines:
>>
>>Receive from input "28/06/2001"
>>Want to change it to "2001-06-28" to write the Database
>>Use to do it "DATE_FORMAT (inputdate, %Y-%m-%d)"
>>
>>It doesn't work fine
>>
>>Thanks a lot for your time

Mike(mickalo)Blezien

Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002
=
















-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Date format problem

2001-06-28 Thread Sebastiaan J.A. Kamp

What programming language are you using?


Hi guys, does anyone help me with this simple thing ??

I have a date format problem, I need a spanish format please read the
following lines:

Receive from input "28/06/2001"
Want to change it to "2001-06-28" to write the Database
Use to do it "DATE_FORMAT (inputdate, %Y-%m-%d)"

It doesn't work fine

Thanks a lot for your time



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Re: Date format problem

2001-06-28 Thread MikeBlezien

On Thu, 28 Jun 2001 15:30:14 -0300, Alejandro Ralla <[EMAIL PROTECTED]>
wrote:

You would need to reformat the input date first, within your middleware, like
Perl or PHP. Then you would be able to enter it into your db.

 
>>Hi guys, does anyone help me with this simple thing ??
>>
>>I have a date format problem, I need a spanish format please read the following 
>lines:
>>
>>Receive from input "28/06/2001"
>>Want to change it to "2001-06-28" to write the Database
>>Use to do it "DATE_FORMAT (inputdate, %Y-%m-%d)"
>>
>>It doesn't work fine
>>
>>Thanks a lot for your time
>>
>>
>>Lic. Alejandro Ralla
>>Districomp S.A
>>Magallanes 1688
>>Montevideo 11200
>>Uruguay
>>
>>(5982)400-1115 int 119
>>[EMAIL PROTECTED]
>>
>>www.districomp.com

Mike(mickalo)Blezien

Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002
=
















-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Date format problem

2001-06-28 Thread Alejandro Ralla


Hi guys, does anyone help me with this simple thing ??

I have a date format problem, I need a spanish format please read the following lines:

Receive from input "28/06/2001"
Want to change it to "2001-06-28" to write the Database
Use to do it "DATE_FORMAT (inputdate, %Y-%m-%d)"

It doesn't work fine

Thanks a lot for your time


Lic. Alejandro Ralla
Districomp S.A
Magallanes 1688
Montevideo 11200
Uruguay

(5982)400-1115 int 119
[EMAIL PROTECTED]

www.districomp.com