Is this possible? (php)

SpaceshipSpaceship
Watch

adam_uk

Established Member
Impact
20
hey
quick question
i have a date for example like this

Thursday 25th of March 2004 11:19:05 AM

generated with php date function is there anyway to convert this into a timestamp?

dont really wanna edit 400 rows in a mysql db lol
ie 3676567354

thanks
adam
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
A little regex is needed to make strtotime recognize the date. The below should work:
PHP:
<?
$string="Thursday 23rd of March 2004 11:19:05 PM";
$timestamp=strtotime(preg_replace("#([0-9]+)(th|rd|st) of #","$1 ",$string));
?>
 
0
•••
you genius!! thanks!
 
0
•••
My pleasure. Thank you for the NP donation.
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back