troubleshooting Question

Time Format

Avatar of David Schure
David Schure asked on
PHP
3 Comments1 Solution19 ViewsLast Modified:
I am using this format for tiem.  It works great. Only problem is that it shows 12:00 as 00:00 what do I need to adjust on this? Please.
$startTime = sprintf("%02d:00", $i % 12) . ($i < 12 ? 'am' : 'pm');
$endTime = sprintf("%02d:00", ($i+1) % 12) . ($i < 11 ? 'am' : 'pm'); // same as $i = 1 < 12

Open in new window


ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros