Re: String to Date and Date to String Functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 Jan 2005 19:22:40 -0000, Ford, Mike <M.Ford@xxxxxxxxxxxxxx> 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
> > <jay.blanchard@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > > [snip]
> > >
> > > String to Date Function
> > > ----------------------------
> > > return date stringToDate( str Date, str Format )
> > > e.g. $todayDt = stringToDate( '01/01/2003','DD/MM/YYYY' );
> > >
> > > Date to String Function
> > > ----------------------------
> > > return str dateToString( date Date, str Format )
> > > e.g. $todayStr = dateToString ( $todayDt,'DD/MM/YYYY' );
> > >
> > > Anyone know of any functions that do this or have pointers as to
> > > how it can be done. [/snip]
> > >
> > > You've looked at http://www.php.net/date ?
> > >
> > Yes.  It douse the dateToString bit but how do I do the reverse.  I
> > can use it to convert a timestamp to a string but how do I convert a
> > string to a timestamp.
> 
> Right at the top of the description of date(), the second Note reads:
> 
>    Note: To generate a timestamp from a string representation of the
>    date, you may be able to use strtotime().

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-YYYY which is the way dates are specified in
the UK, strtodate() cant handle this.  strtodate is not the reverse of
date.

Your email address seems to indicate you are in the UK - so you may of
come across the way UK dates are normaly specified;)

Ben
 
> This should give you a clue.
> 
> 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: m.ford@xxxxxxxxxxxxxx
> Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211
> 


-- 
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux