[PHP] date format from a database date field

2007-05-23 Thread Mike Ryan
Sorry I am a bit of a newbie with php and hope this has not been aswered a
million times, but here it goes

I have a date base with a couple of date fields when I pull up and display
the fields it show 2007-05-21. the question I have is how to convert the
field to 05-21-2007?

Currently the command I have is

print $row['open'];

any help would be apreciative.

thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date format from a database date field

2007-05-23 Thread Daniel Brown

On 5/21/07, Mike Ryan [EMAIL PROTECTED] wrote:


Sorry I am a bit of a newbie with php and hope this has not been aswered a
million times, but here it goes

I have a date base with a couple of date fields when I pull up and display
the fields it show 2007-05-21. the question I have is how to convert the
field to 05-21-2007?

Currently the command I have is

print $row['open'];

any help would be apreciative.

thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   For starters, try to keep all similar requests in one single email
otherwise you look like your spamming the hell out of the list.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


[PHP] Date Format error

2004-11-25 Thread Stuart Felenstein
I'm getting a:
Parse error: parse error, unexpected '%' in
/home/mysite/public_html/userpage.php on line 120

 th scope=row?php echo
$rsVJ-Fields('DATE_FORMAT(LstUpdate,'%m/%d/%Y')');
?/th
  th scope=row?php echo
$rsVJ-Fields('DATE_FORMAT(InitOn,'%m/%d/%Y')');
?/th
  th scope=row?php echo
$rsVJ-Fields('DATE_FORMAT(PostStart,'%m/%d/%Y')');
?/th

Using this format /syntax
DATE_FORMAT(PostStart,'%m/%d/%Y')worked in a regular
database query.  Apparently not with echo.  I tried no
', also tried  around them, both produced nothing, no
error but no returned date.
Thank you 
Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Date Format error

2004-11-25 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 November 2004 18:39, Stuart Felenstein wrote:

 I'm getting a:
 Parse error: parse error, unexpected '%' in
 /home/mysite/public_html/userpage.php on line 120
 
  th scope=row?php echo
 $rsVJ-Fields('DATE_FORMAT(LstUpdate,'%m/%d/%Y')');

Attempting to use unescaped single quotes within a single-quoted string --
not a good idea.  Either double quote the entire DATE_FORMAT() string, or
escape the embedded single quotes.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date format question

2003-11-25 Thread Manisha Sathe
Thanks to all, it help me a lot

manisha

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Date format question

2003-11-24 Thread Manisha Sathe
I have a date returned from MySQL in '-MM-DD' format, i want to show
this date in 'DD/MM/' format using PHP, date() function does the same if
i pass timestamp in int format, but how to convert  into int timestamp ?

e.g from '2003-11-25' to '20031125' ? and
Then I believe that i can use date (d/m/Y, '20031125' ) to the things done
?

Thanks in advance,

regards,
manisha

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date format question

2003-11-24 Thread John W. Holmes
Manisha Sathe wrote:
I have a date returned from MySQL in '-MM-DD' format, i want to show
this date in 'DD/MM/' format using PHP, date() function does the same if
i pass timestamp in int format, but how to convert  into int timestamp ?
e.g from '2003-11-25' to '20031125' ? and
Then I believe that i can use date (d/m/Y, '20031125' ) to the things done
?
No, date() expects a unix timestamp. You can either use

SELECT UNIX_TIMESTAMP(your_column) AS foo FROM Table ...

and then use the value in column 'foo' in date(), or just use 
DATE_FORMAT() in your query to retrieve the row already formatted.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date format question

2003-11-24 Thread Justin French
On Tuesday, November 25, 2003, at 01:42  PM, Manisha Sathe wrote:

I have a date returned from MySQL in '-MM-DD' format, i want to 
show
this date in 'DD/MM/' format using PHP, date() function does the 
same if
i pass timestamp in int format, but how to convert  into int timestamp 
?

e.g from '2003-11-25' to '20031125' ? and
Then I believe that i can use date (d/m/Y, '20031125' ) to the 
things done
?


?
// the original
$mysql_date = '2003-11-25';
// convert to a unix timestamp (seconds since 1970)
$mysql_date_stamp = strtotime($mysql_date);
// pass $mysql_date_stamp to date() as 2nd parameter
$human_date = date('d/m/Y',$mysql_date_stamp);
echo $human_date;
?
or simplified:

?
$original = '2003-11-25';
echo date('d/m/Y', strtotime($original));
?
Justin French

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Date format from file

2003-02-05 Thread ed

 Is it possible to read a string from a text file (i.e.
0502031130) and be able to use that in a date function such as: 

$date = date(dmyHi, strtotime('+28 days));

 How would I use that string as the date in the above code?

TIA,

Ed




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date format from file

2003-02-05 Thread Tom Rogers
Hi,

Thursday, February 6, 2003, 2:41:42 AM, you wrote:

ehhc  Is it possible to read a string from a text file (i.e.
ehhc 0502031130) and be able to use that in a date function such as: 

ehhc $date = date(dmyHi, strtotime('+28 days));

ehhc  How would I use that string as the date in the above code?

ehhc TIA,

ehhc Ed


If you change the format of your string you can do this:

$t = 20030205 1530;

echo 'New date/time = '.date(d/m/Y H:i,strtotime($t. + 28 days)).'br';




-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date format from file

2003-02-05 Thread John W. Holmes
  Is it possible to read a string from a text file (i.e.
 0502031130) and be able to use that in a date function such as:
 
 $date = date(dmyHi, strtotime('+28 days));
 
  How would I use that string as the date in the above code?

What database are you using? You can probably do all of this in your SQL
statement if you're using the correct columns. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date format from file

2003-02-05 Thread ed

 I'm not using this for any database related function. What I'm trying to
do is come up with a method for scheduling processes needed for our
company that are run through command line php scripts. I'll be using cron
or to run a command that will check the date within the file and see if
the process needs to be run on that day and then rewrite the date + 28
days back into the file spawning the process if need be. To the best of my
knowledge cron cannot run schedules this way. It can only run on specific
days or times outlined directly. Our processes must run every 28 days, not
a specific day of the month. If there is any other scheduling system out
there that can do this type of thing on Linux/Unix I'd much rather use it
than doing it this way.

Ed


On Wed, 5 Feb 2003, John W. Holmes wrote:

   Is it possible to read a string from a text file (i.e.
  0502031130) and be able to use that in a date function such as:
  
  $date = date(dmyHi, strtotime('+28 days));
  
   How would I use that string as the date in the above code?
 
 What database are you using? You can probably do all of this in your SQL
 statement if you're using the correct columns. 
 
 ---John W. Holmes...
 
 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date format from file

2003-02-05 Thread John W. Holmes
  I'm not using this for any database related function. What I'm trying
to
 do is come up with a method for scheduling processes needed for our
 company that are run through command line php scripts. I'll be using
cron
 or to run a command that will check the date within the file and see
if
 the process needs to be run on that day and then rewrite the date + 28
 days back into the file spawning the process if need be. To the best
of my
 knowledge cron cannot run schedules this way. It can only run on
specific
 days or times outlined directly. Our processes must run every 28 days,
not
 a specific day of the month. If there is any other scheduling system
out
 there that can do this type of thing on Linux/Unix I'd much rather use
it
 than doing it this way.

Sorry, I though I read database in there somewhere. 

I don't know of another program. As long as you write a unix timestamp
or some date format that can be parsed by strtotime(), then you can do
it this way. Use fopen()/fread() to get the last time saved in the file.
If you're using unix timestamps, just see if the current time is greater
than the old timestamp + 28 days...

If(time()  $old_timestamp + 60*60*24*28)
{ //run script and save new time(); }

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date format from file (END)

2003-02-05 Thread ed


 I don't know of another program. As long as you write a unix timestamp
 or some date format that can be parsed by strtotime(), then you can do
 it this way. Use fopen()/fread() to get the last time saved in the file.
 If you're using unix timestamps, just see if the current time is greater
 than the old timestamp + 28 days...
 
 If(time()  $old_timestamp + 60*60*24*28)
 { //run script and save new time(); }
 
 ---John W. Holmes...
 

 Thanks alot for all the help. Using cron to run the checktime script I
can then make sure the process gets run on the exact time it needs to be
run along with the exact date in the file.

Ed



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com

Reformatting before an inserting/updating is one option, but how would we 
change the mySQL database to accept the other format?

Peter


At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote:
Why can't you just reformat it before inserting it into the db?

 $date = 31.12.2002;

 $parts = split(\., $date);
 echo $parts[2].-.$parts[1].-.$parts[0];

- jacob

At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

 It looks to me like the database is interpreting your date
 incorrectly.  Try changing the format you use to insert, -mm-dd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date-format

2002-09-18 Thread Jacob Miller

 From http://www.mysql.com/doc/en/Using_DATE.html

quote
The format of a DATE value is '-MM-DD'. According to ANSI SQL, no other 
format is allowed. You should use this format in UPDATE expressions and in 
the WHERE clause of SELECT statements. For example:

mysql SELECT * FROM tbl_name WHERE date = '1997-05-05';
/quote

- Jacob

At 02:28 09/19/2002, Support @ Fourthrealm.com wrote:
Reformatting before an inserting/updating is one option, but how would we 
change the mySQL database to accept the other format?

Peter


At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote:
Why can't you just reformat it before inserting it into the db?

 $date = 31.12.2002;

 $parts = split(\., $date);
 echo $parts[2].-.$parts[1].-.$parts[0];

- jacob

At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

 It looks to me like the database is interpreting your date
 incorrectly.  Try changing the format you use to insert, -mm-dd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date-format

2002-09-18 Thread Chuck Payne


I know everyone love to quote read the manual and forget that we[newbies]
are only asking here because we need help...so here you go...

You can do the following...

DATE_FORMAT IS THE MySQL Command

And let say you want to format your date as the following mm-dd-yy(US) or
dd-mm-yy(the rest of the world).

By the way this are format keys

%m the month in numbers,
%d the days in numbers,
%y the year in number
%M spells out the month
%D gives the date with th, rd, nd all that
%Y gives all four numbers

So you do the following sql statement...

SELECT DATE_FORMAT(yourdate, '%m-%d-%y') as youwanttocallit FROM yourtable;

So in your php code you can do this from your MySQL statement...

$youwantcallit = $myrow[youwanttoit];

? echo $youwanttocallit; ?

Advance note

then if you don't want to show 00-00-00 you can do this...

if ($youwanttocallit == 00-00-00) {
  $youwanttocallit = nbsp;;
}

that way you don't have a bunch of 00-00-00 showing up.

I hope that helps, because that is what the maillisting is for and not to
always quote Read the Book.

Chuck Payne
Magi Design and Support



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com


Thanks everyone for the helpful answers.

I agree that manuals are useful, but there are times when an example works 
better.

I took all of this information, and some details from earlier posts about 
dates, and produced the following function to make it easy to format dates 
without have to go through and change sql stmts.

# --- Function to format date output ---
function makedate($format, $indate)
{
 $temp = explode(-, $indate);
 $fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
 $temp = date($format, $fulldate);
 return ($temp);
}


The function gets called like this:

makedate('Y/m/d', $row-articledate);or
makedate(F d, Y, $somedate);


Hopefully this will someone else with their date challenges.


Peter


At 02:55 PM 9/18/2002 -0400, Chuck Payne wrote:

I know everyone love to quote read the manual and forget that we[newbies]
are only asking here because we need help...so here you go...

You can do the following...

DATE_FORMAT IS THE MySQL Command

And let say you want to format your date as the following mm-dd-yy(US) or
dd-mm-yy(the rest of the world).

By the way this are format keys

%m the month in numbers,
%d the days in numbers,
%y the year in number
%M spells out the month
%D gives the date with th, rd, nd all that
%Y gives all four numbers

So you do the following sql statement...

SELECT DATE_FORMAT(yourdate, '%m-%d-%y') as youwanttocallit FROM yourtable;

So in your php code you can do this from your MySQL statement...

$youwantcallit = $myrow[youwanttoit];

? echo $youwanttocallit; ?

Advance note

then if you don't want to show 00-00-00 you can do this...

if ($youwanttocallit == 00-00-00) {
   $youwanttocallit = nbsp;;
}

that way you don't have a bunch of 00-00-00 showing up.

I hope that helps, because that is what the maillisting is for and not to
always quote Read the Book.

Chuck Payne
Magi Design and Support



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Date-format

2002-09-12 Thread Tommi Virtanen

Hi!

I have web-form, which has field (10 chars), there I enter date (format
dd.mm.). Then data saves to database (date-field type is date). 

So everything works, but not fine. When I enter date in format ex.
31.12.2002 and save form, then I'll check what are in db (there are
2031-12-20). 

Is there any chance to correct this problem. 

I have (in clause which insert to db): 

GetSQLValueString($HTTP_POST_VARS['date'], date)

gustavus



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date-format

2002-09-12 Thread Jacob Miller

It looks to me like the database is interpreting your date 
incorrectly.  Try changing the format you use to insert, -mm-dd

- jacob

At 15:11 09/12/2002, Tommi Virtanen wrote:
Hi!

I have web-form, which has field (10 chars), there I enter date (format
dd.mm.). Then data saves to database (date-field type is date).

So everything works, but not fine. When I enter date in format ex.
31.12.2002 and save form, then I'll check what are in db (there are
2031-12-20).

Is there any chance to correct this problem.

I have (in clause which insert to db):

GetSQLValueString($HTTP_POST_VARS['date'], date)

gustavus



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date-format

2002-09-12 Thread Tommi Virtanen

Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

It looks to me like the database is interpreting your date 
incorrectly.  Try changing the format you use to insert, -mm-dd



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date-format

2002-09-12 Thread Jacob Miller

Why can't you just reformat it before inserting it into the db?

 $date = 31.12.2002;

 $parts = split(\., $date);
 echo $parts[2].-.$parts[1].-.$parts[0];

- jacob

At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.,
so I cannot use other insert format (it have to do other way).

gustavus

 It looks to me like the database is interpreting your date
 incorrectly.  Try changing the format you use to insert, -mm-dd



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] date format

2002-04-27 Thread Ananth Rajaraman

Hi all,
I'm trying to query a date field from mySQL and
display in a differnet format.

the mysql date is in the format -MM-DD and I want
to convert it to DD-MM-

how do I do that?

TIA

Ananth

=
visit www.locustechnologies.com

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] date format

2002-04-27 Thread Jason Wong

On Saturday 27 April 2002 14:43, Ananth Rajaraman wrote:
 Hi all,
 I'm trying to query a date field from mySQL and
 display in a differnet format.

 the mysql date is in the format -MM-DD and I want
 to convert it to DD-MM-

 how do I do that?

Use mysql's extensive date formatting functions.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Remember kids, if there's a loaded gun in the room, be sure that you're the 
one holding it
-- Captain Combat
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] date format

2002-04-27 Thread Miguel Cruz

On Fri, 26 Apr 2002, Ananth Rajaraman wrote:
 I'm trying to query a date field from mySQL and
 display in a differnet format.
 
 the mysql date is in the format -MM-DD and I want
 to convert it to DD-MM-
 
 how do I do that?

How did you figure out anything else that you've done in MySQL? There's an 
excellent manual at http://www.mysql.com/ . Please try to at least glance 
at the documentation before posting here. Some questions are so incredibly 
basic that it's clear you didn't even try.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] date format

2002-04-22 Thread hamish

Hello All,
I have a variable in the following date format: 

April 11, 2002, 1:53 pm 

and want to get it to the following format: 

-mm-dd 

what's the best way? 

hamish

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] date format

2002-04-22 Thread Justin French

Hamish,

A quick read through the date functions in the manual is worthwhile
http://www.php.net/manual/en/ref.datetime.php

In particular, you need to look at strtotime() and date().

strtotime() is an often overlooked function, useful for getting almost any
english written date into a unix timestamp, then use date() to get it into
the format you wish.

Note, I removed the commas from the $date string, because I'm pretty sure it
will break the strtotime() function.


?

$date = April 11, 2002, 1:53 pm;

// one step at a time
$date = str_replace(,,,$date);
$date = strtotime($date);
$date = date('Y-m-d', $date);

// or, in one line, if that's your thing
$date = date('Y-m-d', strtotime(str_replace(,,,$date)));

?


Alternatively, you could have split the date on commas, and mucked around
with each element, but the above, IMHO, is the best way to go.


Regards,

Justin French

Creative Director
http://Indent.com.au





on 22/04/02 10:10 PM, hamish ([EMAIL PROTECTED]) wrote:

 Hello All,
 I have a variable in the following date format:
 
 April 11, 2002, 1:53 pm
 
 and want to get it to the following format:
 
 -mm-dd 
 
 what's the best way?
 
 hamish


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Date format

2002-02-01 Thread Jose

Hi all.
How can I write the date in this format (dd/mm/) if php gives me
(,mm,dd)??

Thanks

--Jose Fco. ( [EMAIL PROTECTED] ).
OLINET, S.L. Teléfono: 952207135 - Fax: 952207600
Avda. Juan Sebastián Elcano, 39-41. 29017 Málaga. Spain

--




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Date format

2002-02-01 Thread Rick Emery

list($y,$m,$d) = explode(,,$phpdate);
$newdate = $d/$m/$y;

-Original Message-
From: Jose [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date format


Hi all.
How can I write the date in this format (dd/mm/) if php gives me
(,mm,dd)??

Thanks

--Jose Fco. ( [EMAIL PROTECTED] ).
OLINET, S.L. Teléfono: 952207135 - Fax: 952207600
Avda. Juan Sebastián Elcano, 39-41. 29017 Málaga. Spain

--




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date format

2002-02-01 Thread Anas Mughal

I don't know how you are getting your (,mm,dd).

But, try looking the date function.
It should do the trick for you.




--- Jose [EMAIL PROTECTED] wrote:
 Hi all.
 How can I write the date in this format (dd/mm/)
 if php gives me
 (,mm,dd)??
 
 Thanks


 --Jose Fco. ( [EMAIL PROTECTED] ).
 OLINET, S.L. Teléfono: 952207135 - Fax: 952207600
 Avda. Juan Sebastián Elcano, 39-41. 29017 Málaga.
 Spain


 --
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Anas Mughal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel: 973-249-6665

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date format

2002-02-01 Thread Mike Frazer

$today = date(d/m/Y);

That will get the current date and dump it in the format you asked for
(DD/MM/, complete with leading zeros).

Mike Frazer


Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
list($y,$m,$d) = explode(,,$phpdate);
$newdate = $d/$m/$y;

-Original Message-
From: Jose [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date format


Hi all.
How can I write the date in this format (dd/mm/) if php gives me
(,mm,dd)??

Thanks

--Jose Fco. ( [EMAIL PROTECTED] ).
OLINET, S.L. Teléfono: 952207135 - Fax: 952207600
Avda. Juan Sebastián Elcano, 39-41. 29017 Málaga. Spain

--




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] DATE FORMAT ISSUES

2001-10-22 Thread Beeman

I have inserted the date into MySQL using now() in the query. However, when
I retrieve the using MySQL_Date_Format in the query the time is always
wrong. on the other hand, if I format the date using Date() in PHP it always
makes the date DEC 31 1969 at 700PM. Please Help



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] date format for MySQL

2001-02-21 Thread Jerry Lake

I have a field in my MySQL DB that is "DATE"

on the form that populates this field, various
people will by typing in dates in various formats

how to I convert say 2/21/01 or 02-21-2001 etc...
to 2001-02-21(MySQL Format)

Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] date format for MySQL

2001-02-21 Thread Mark Maggelet

On Wed, 21 Feb 2001 11:36:02 -0800, Jerry Lake ([EMAIL PROTECTED])
wrote:
I have a field in my MySQL DB that is "DATE"

on the form that populates this field, various
people will by typing in dates in various formats

how to I convert say 2/21/01 or 02-21-2001 etc...
to 2001-02-21(MySQL Format)

probably the safest thing is instead of giving them a text field,
give them 3 drop downs for day month and year.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]