Advertisement
badlogic

get date format in year and month

Jul 20th, 2018
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.24 KB | None | 0 0
  1.  
  2. //get the month only in php
  3. $date = DateTime::createFromFormat('Y-m-d', $conver_month);
  4. $conver_month = $date->format('Y-m');
  5.  
  6. //get the month only in mysql
  7. where  fsd.fs_sec_id = $sec_id  and date_format(cth.th_trandate,'%Y-%m') = '$month'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement