Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-11-2005, 06:11 AM   #1
Dusen
Confirmed User
 
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
PHP Guys - strtotime Help

PHP Code:
<?php

$datestring
=date("l dS of F Y h:i:s A");
$returntime=strtotime($datestring);
echo 
$datestring." READ IN ".$returntime." RETURNED\n";

?>
Is my date string not a valid format? Seems fairly standard. How can I fix?
__________________
Penis Pill Sponsor List and Reviews:
http://www.pillsponsors.com
Dusen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2005, 06:14 AM   #2
KRL
Entrepreneur
 
Join Date: Oct 2002
Location: USA
Posts: 31,429
<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('UTC');


// Prints something like: Monday
echo date("l");

// Prints something like: Monday 15th of August 2005 03:12:46 PM
echo date('l dS \of F Y h:i:s A');

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

/* use the constants in the format parameter */
// prints something like: Mon, 15 Aug 2005 15:12:46 UTC
echo date(DATE_RFC822);

// prints something like: 2000-07-01T00:00:00+0000
echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));
?>
__________________
If you would like to develop your domains, you can lease inexpensive foreign labor
from the leaders in the field at iWebmasters.com TO LOWER YOUR COSTS AND INCREASE YOUR PRODUCTION!

*** *** *** *** *** *** *** *** *** *** *** ***
Domains Adult News KRL's Newsletter Biz Tips Just Listed Domains
KRL is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2005, 06:18 AM   #3
Dusen
Confirmed User
 
Join Date: Aug 2002
Location: East Coast.
Posts: 2,251
Thanks KRL, but I guess I should clarify.

I'm parsing logfiles already written in that date format I gave.

Strtotime won't convert to timestamp.

I guess I could make a complicated scanf statement but I figured that date format was HIGHLY standard.
__________________
Penis Pill Sponsor List and Reviews:
http://www.pillsponsors.com
Dusen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2005, 08:04 AM   #4
cpanic
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Posts: 267
PHP Code:
<?
$datestring=date("l dS of F Y h:i:s A");
$dateArray = split(" ",$datestring);
$year = $dateArray[4];
$month = $dateArray[3];
$day = preg_replace('/[^0-9]/', '',$dateArray[1]);
list($hour,$min,$sec) = explode(':',$dateArray[5]);
$returntime = mktime($hour,$min,$sec,$month,$day,$year);
echo $datestring." READ IN ".$returntime." RETURNED\n"; 

?>
__________________
cpanic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.