i want to convert this : Fri Jul 25 14:33:21 2003 to seconds since 1970. so i use strtotime BUT
strtotime ("Fri Jul 25 14:33:21 2003"); doesn't work
i must put : strtotime ("Fri Jul 25 2003 14:33:21");
so from Fri Jul 25 14:33:21 2003 how to have Fri Jul 25 2003 14:33:21
i tried : date("D M j Y G:i:s", "Fri Jul 25 14:33:21 2003");
but it doesn't work...
so far i have managed this:
<?php
$string = "Fri Jul 25 14:33:21 2003";
list($week, $month, $day, $time, $year) = split(" ", $string);
$newdate = "$week $month $day $year $time";
echo "$newdate\n";
?>
to just move 14:33:21 to end
ie, reformat that time string
but it is quite messy, can anyone show me a proper/prettier way to do this . i would be happy! thanks...
Need help with Date function
Moderator: General Moderators
-
matthiasone
- Forum Contributor
- Posts: 117
- Joined: Mon Jul 22, 2002 12:14 pm
- Location: Texas, USA
- Contact: