2009-12-31 16 views
5

मेरे पास "6:15 बजे" की तरह एक स्ट्रिंग है। क्या PHP में कोई फ़ंक्शन है जो इसे सीधे 24 घंटे प्रारूप में परिवर्तित कर देगा। यानी "18:15"? strtotime() साथPHP 12 घंटे प्रारूप 24hr प्रारूप समय में कनवर्ट करना

print date("H:i", strtotime("6:15pm")); 

उत्तर

1
//Call this once before the 1st date/time operation 
date_default_timezone_set('Europe/Zurich'); 

echo date('H:i', strtotime('6:15pm')); 
संबंधित मुद्दे