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 C
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 200
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
> 01/01
> -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 o
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 charact
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
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 distribute
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
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 w
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 PROTECT
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
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
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 Blancha
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-
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?
> > http://
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( '01/01
[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
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
> > ---
, display it on a form, 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]>
>
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
> Subject: Re: [PHP] Str
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
> --
[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 func
22 matches
Mail list logo