Warning: Declaration of LJXP_Walker_Category_Checklist::start_lvl(&$output, $depth, $args) should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/lj-xp/lj-xp-options.php on line 771

Warning: Declaration of LJXP_Walker_Category_Checklist::end_lvl(&$output, $depth, $args) should be compatible with Walker::end_lvl(&$output, $depth = 0, $args = Array) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/lj-xp/lj-xp-options.php on line 776

Warning: Declaration of LJXP_Walker_Category_Checklist::start_el(&$output, $category, $depth, $args) should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/lj-xp/lj-xp-options.php on line 781

Warning: Declaration of LJXP_Walker_Category_Checklist::end_el(&$output, $category, $depth, $args) should be compatible with Walker::end_el(&$output, $object, $depth = 0, $args = Array) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/lj-xp/lj-xp-options.php on line 793

Warning: Use of undefined constant odnaknopka - assumed 'odnaknopka' (this will throw an Error in a future version of PHP) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/odnaknopka/ok2.php on line 11

Warning: Use of undefined constant ddsg_language - assumed 'ddsg_language' (this will throw an Error in a future version of PHP) in /var/www/u3357911/data/www/karta39.ru/blog/wp-content/plugins/sitemap-generator/sitemap-generator.php on line 44
Blog » программирование

Архив

Публикации с меткой ‘программирование’

SQL разница между датами

везде предлагается использовать функцию DATEDIFF()
но когда мне потребовалось высчитать разницу между датами в днях — у меня это почему-то не вышло :(
пришлось изобрести велосипед (аж две штуки):
1. (UNIX_TIMESTAMP(`date2`)-UNIX_TIMESTAMP(`date1`))/86400)
2. (TO_DAYS(`date2`) - TO_DAYS(`date1`))

например, узнать сколько прошло дней от даты `date1`:
(TO_DAYS(NOW()) - TO_DAYS(`date1`))

вот собственно и всё :)

goto ?

22 Декабрь 2009 Нет комментариев