From: | Andrew |
Sent on: | Saturday, July 23, 2016, 10:02 PM |
Yup, sorry. I missed copying $format into the top of the code sample. :-)And yes, I'll be in Seattle for PNWPHP!That reminds me: Y'all need to get your tickets!!! Check out the schedule this year: http://pnwphp.com/2016/schedule--Co-organizer of the Arizona PHP User Group (@azphp)Co-founder of the Pacific Northwest PHP Conference (@PNWPHP)On Sat, Jul 23, 2016 at 12:14 PM, Tim Bond <[address removed]> wrote:Jeremy's snippet works fine for me; just have to set $format to something that date() recognizes
https://3v4l.org/3VJ5L
On 7/23/[masked]:10, max steinmetz wrote:
Please Note: If you hit "*REPLY*", your message will be sent toHi Jeremy - so i tried all three and all three gave me white pages of death.
I added default time, tried turning ‘$time’ to ‘$myTime’ in case ‘time’
was reserved keyword.
Not sure what i’m doing wrong.
Thanks
date_default_timezone_set('America/Los_Angeles');
// Using DateTime objects, via the date_* functions
// Using strtotime() function (Easiest)
$time = strtotime('[masked]:55:24');
for ($x = 0; $x < 12; $x++) {
$time = strtotime('+67 seconds', $time);
echo date($format, $time) . "<br>";
}
echo "<br>";
// Using DateTime objects, via the date_* functions
$time = date_create('[masked]:55:24');
for ($x = 0; $x < 12; $x++) {
date_add($time, date_interval_create_from_date_string('67 seconds'));
echo date_format($time, $format) . "<br>";
}
echo "<br>";
// Using DateTime objects, via Date* class methods
$time = new DateTime('[masked]:55:24');
for ($x = 0; $x < 12; $x++) {
$time->add(new DateInterval('PT67S'));
echo $time->format($format) . "<br>";
}
--
*everyone* on this mailing list ([address removed]
<mailto:[address removed]>)
This message was sent by Meetup on behalf of max steinmetz
<http://www.meetup.com/seaphp/members/2821890/> from Seattle PHP User
Group <http://www.meetup.com/seaphp/>.
To report this message or block the sender, please click here
<http://www.meetup.com/seaphp/abuse/2821890/?table_name=ml&table_id=78878263>
Set my mailing list to email me As they are sent
<http://www.meetup.com/seaphp/list_prefs/?pref=1> | In one daily email
<http://www.meetup.com/seaphp/list_prefs/?pref=2> | Don't send me
mailing list messages <http://www.meetup.com/seaphp/list_prefs/?pref=0>
Meetup, POB 4668 #37895 NY NY USA 10163 <#> | [address removed]
--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/seaphp/
This message was sent by Meetup on behalf of Tim Bond (http://www.meetup.com/seaphp/members/11114457/) from Seattle PHP User Group.
Set my mailing list to email me
As they are sent
http://www.meetup.com/seaphp/list_prefs/?pref=1
In one daily email
http://www.meetup.com/seaphp/list_prefs/?pref=2
Don't send me mailing list messages
http://www.meetup.com/seaphp/list_prefs/?pref=0
Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]
This message was sent by Meetup on behalf of Jeremy Cole Lindblom from Seattle PHP User Group.
--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages
Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]