Re: [PHP] String to Date Conversion Problem

2009-07-31 Thread Stuart Connolly
Hi Alice, Based on the string format that you mentioned (DD MMM YY - DAY) you should be able to transform to any other date using the following: $parts = explode(' ', '23 JUL 09 - THURSDAY'); echo date('m/d/Y', strtotime({$parts[1]} {$parts[0]} {$parts[2]})); Cheers Stuart On 31 Jul

RE: [PHP] String to Date Conversion Problem

2009-07-31 Thread Alice Wei
Looks like what I did by using mm/dd/ was extra, which was probably why it didn't work. Thanks, looks like this is up and running now. Alice CC: php-general@lists.php.net From: stu...@stuconnolly.com To: aj...@alumni.iu.edu Subject: Re: [PHP] String to Date Conversion Problem Date

Re: [PHP] String to date

2008-06-30 Thread Bastien Koert
On Mon, Jun 30, 2008 at 4:58 PM, Mark Bomgardner [EMAIL PROTECTED] wrote: I need to convert a date retrieved from user input to a mysql date. Here the problem, I need to convert one of three possible combinations, either 01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's

Re: [PHP] String to date

2008-06-30 Thread Wolf
Mark Bomgardner [EMAIL PROTECTED] wrote: I need to convert a date retrieved from user input to a mysql date. Here the problem, I need to convert one of three possible combinations, either 01/01/2008,01-01-2008 or 01.01.2008. I can't use explode because it's limited to one character to

RE: [PHP] String to date

2008-06-30 Thread Boyd, Todd M.
-Original Message- From: Mark Bomgardner [mailto:[EMAIL PROTECTED] Sent: Monday, June 30, 2008 3:58 PM To: php-general@lists.php.net Subject: [PHP] String to date I need to convert a date retrieved from user input to a mysql date. Here the problem, I need to convert one of three

Re: [PHP] String to date

2008-06-30 Thread mike503
couldn't strtotime() do this without any mods? I personally would try that first... On 6/30/08, Mark Bomgardner [EMAIL PROTECTED] wrote: I need to convert a date retrieved from user input to a mysql date. Here the problem, I need to convert one of three possible combinations, either

RE: Re: [PHP] String to Date and Date to String Functions?

2005-01-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 January 2005 00:25, Ben Edwards wrote: On Mon, 24 Jan 2005 20:15:15 -, Ford, Mike [EMAIL PROTECTED] wrote: To view the terms under which this email is distributed,

RE: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Jay Blanchard
[snip] Being trying to work out haw to handle dates. Basically I need a function to convert a Date to a String and another function to convert a string to a date. Exactly what format the date is held in is not relevant as long as it is some type of standard (i.e. Unix Timestamps). Both the

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ben Edwards
On Mon, 24 Jan 2005 10:38:03 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] String to Date Function return date stringToDate( str Date, str Format ) e.g. $todayDt = stringToDate( '01/01/2003','DD/MM/' ); Date to String Function

Re: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread hitek
How about the strtotime() function? http://us4.php.net/manual/en/function.strtotime.php From: Ben Edwards [EMAIL PROTECTED] Date: 2005/01/24 Mon PM 12:03:34 EST To: Jay Blanchard [EMAIL PROTECTED] CC: PHP General List php-general@lists.php.net Subject: Re: [PHP] String to Date and Date

Re: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ben Edwards
, validate it, and then convert it back to a timestamp. I cant beleve the PHP date/time functions suck this bad;( Ben From: Ben Edwards [EMAIL PROTECTED] Date: 2005/01/24 Mon PM 12:03:34 EST To: Jay Blanchard [EMAIL PROTECTED] CC: PHP General List php-general@lists.php.net Subject: Re: [PHP

RE: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 24 January 2005 17:04, Ben Edwards wrote: On Mon, 24 Jan 2005 10:38:03 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] String to Date Function

RE: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Jay Blanchard
[snip] On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How about the strtotime() function? http://us4.php.net/manual/en/function.strtotime.php No good, it douse not take a format string. What if I wanted to convert the timestamp to 'DD-MM-YYY', display it on a

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Bret Hughes
On Mon, 2005-01-24 at 11:03, Ben Edwards wrote: On Mon, 24 Jan 2005 10:38:03 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] String to Date Function return date stringToDate( str Date, str Format ) e.g. $todayDt = stringToDate(

RE: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 24 January 2005 19:01, Ben Edwards wrote: On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How about the strtotime() function?

Re: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Richard Lynch
Ben Edwards wrote: On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How about the strtotime() function? http://us4.php.net/manual/en/function.strtotime.php No good, it douse not take a format string. What if I wanted to convert the timestamp to 'DD-MM-YYY',

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ben Edwards
On Mon, 24 Jan 2005 19:22:40 -, Ford, Mike [EMAIL PROTECTED] wrote: To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 24 January 2005 17:04, Ben Edwards wrote: On Mon, 24 Jan 2005 10:38:03 -0600, Jay Blanchard

Re: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ben Edwards
On Mon, 24 Jan 2005 13:32:36 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How about the strtotime() function? http://us4.php.net/manual/en/function.strtotime.php No good, it douse not take a format

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Jason Wong
On Tuesday 25 January 2005 08:07, Ben Edwards wrote: As I have said in a previous email to date function takes a format string and the strtodate douse not. Therefore the strtodate() only works on a small subset of what date() can produce. The format I am interested in is DD-MM- which is

Re: Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Ben Edwards
On Mon, 24 Jan 2005 20:15:15 -, Ford, Mike [EMAIL PROTECTED] wrote: To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 24 January 2005 19:01, Ben Edwards wrote: On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED]

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Jason Wong
On Tuesday 25 January 2005 08:09, Ben Edwards wrote: Well, you could always write some extensions to PHP to cover it, as soon as you learn to spell does :) That is awfull grammer. Ime dyslexic, whats your excuse. Does is spelt 'does' not 'douse', that grammar looks OK to me. Was

Re: [PHP] String to Date and Date to String Functions?

2005-01-24 Thread Rick Fletcher
Ben Edwards wrote: The format I am interested in is DD-MM- which is the way dates are specified in the UK, strtodate() cant handle this. Ben, there is no (built in) string-timestamp function that takes a format. strtotime() is pretty smart about interpreting your input, but it's limited to