[PHP-DB] Date Conversion in RFC822 format

2006-05-18 Thread Manoj Singh

Hello all,

I am developing a site in php implementing the concept of rss feeds. For
that i want to convert the standard date into RFC822 format.

If any one have idea about it, please help me.

Regards
Manoj


Re: [PHP-DB] Date Conversion in RFC822 format

2006-05-18 Thread Stut

Manoj Singh wrote:

I am developing a site in php implementing the concept of rss feeds. For
that i want to convert the standard date into RFC822 format.

If any one have idea about it, please help me.


Go to http://php.net/date and search the page for RFC822. If you need 
further help read the rest of that page.


-Stut

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



[PHP-DB] Date Conversion

2006-05-16 Thread Mark Bomgardner

PHP 4.4/MySQL 4.0

I am tying to convert a date to put into a database from a string (ie: 
January, February) to a numeric value (ie: 01,02).  I am taking the 
value from a form, which is a drop down menu listing the months.


$sMonth1 = $_POST['Smonth']; returns the money selected from the form.
When I go to format the month from a string to numeric with 
date('m',strtotime($sMonth1));

it returns 12, no matter which month I select.

In reading the docs at php.net, date('m',strtotime($sMonth1)); is 
correct to reformat from a string to a time format.


What am I missing.


mark bomgardner

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



RE: [PHP-DB] Date Conversion

2006-05-16 Thread Ralph Brickley
A simple associate array would work as well, although not quite as elegent.
$months_arr = array(January=01, February=02...);

-Original Message-
From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 16, 2006 12:35 PM
To: Php-Db
Subject: [PHP-DB] Date Conversion

PHP 4.4/MySQL 4.0

I am tying to convert a date to put into a database from a string (ie: 
January, February) to a numeric value (ie: 01,02).  I am taking the 
value from a form, which is a drop down menu listing the months.

$sMonth1 = $_POST['Smonth']; returns the money selected from the form.
When I go to format the month from a string to numeric with 
date('m',strtotime($sMonth1));
it returns 12, no matter which month I select.

In reading the docs at php.net, date('m',strtotime($sMonth1)); is 
correct to reformat from a string to a time format.

What am I missing.


mark bomgardner

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

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



RE: [PHP-DB] Date Conversion

2006-05-16 Thread Ralph Brickley
ADDENDUM:

To Convert your date string, use the associate array:
$months_arr = array(January=01, February
=02...);

$month = $months_arr[February];

* Replace $months_arr[February] with $_POST[Month];

// Output
$month = 01;



Ralph Brickley

-Original Message-
From: Ralph Brickley [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 16, 2006 1:29 PM
To: [EMAIL PROTECTED]; 'Php-Db'
Subject: RE: [PHP-DB] Date Conversion

A simple associate array would work as well, although not quite as elegent.
$months_arr = array(January=01, February=02...);

-Original Message-
From: Mark Bomgardner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 16, 2006 12:35 PM
To: Php-Db
Subject: [PHP-DB] Date Conversion

PHP 4.4/MySQL 4.0

I am tying to convert a date to put into a database from a string (ie: 
January, February) to a numeric value (ie: 01,02).  I am taking the 
value from a form, which is a drop down menu listing the months.

$sMonth1 = $_POST['Smonth']; returns the money selected from the form.
When I go to format the month from a string to numeric with 
date('m',strtotime($sMonth1));
it returns 12, no matter which month I select.

In reading the docs at php.net, date('m',strtotime($sMonth1)); is 
correct to reformat from a string to a time format.

What am I missing.


mark bomgardner

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

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

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



[PHP-DB] Date Conversion

2004-08-18 Thread Ng Hwee Hwee
Hi all,

can someone kindly point me to a resource that converts all kinds of possible date 
inputs into MySQL format of -MM-DD?

example of formats to be converted includes:

d/m/yy
d/m/
d/mm/yy
d/mm/yyy
dd/mm/yy
dd/mm/yyy
d/mmm/yy
d/mmm/
dd/mmm/yy
dd/mmm/

yy   - 2 digit representation of year
   - ful numeric representation of year
m   - numeric representation of month, without leading zero
mm- numeric representation of month, with leading zero
mmm - short textual representation of month   
d   - day of month without leading zero
dd - day of month with leadin zero

thanx!

hwee