Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php /* setlocale(LC_TIME, "en_US"); echo strftime('%F', time()); echo date('Y-m-d', time()); */ function strf_time($format, $timestamp, $locale) { $date_str = strftime($format, $timestamp); if (strpos($locale, '1251') !== false) { return iconv('cp1251', 'utf-8', $date_str); } else { return $date_str; } } strf_time("%Y-%m", strtotime('2025-01-20 17:12:42'), setlocale(LC_TIME, 'ru_RU.UTF-8', 'Rus'));
Copy Clear