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
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
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
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
-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
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
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,
[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
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
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
, 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
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
[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
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(
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?
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',
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
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
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
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]
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
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
22 matches
Mail list logo