Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PHP – Date Conversion

Posted on September 15, 2017 By David Kittell

  /* (c) 2003 Drew Butler 
   * If you use this code please remember who wrote it. :) 
   * 
   * Simple conversion tool that takes the standard date format of 
   * yyyy-mm-dd and turns it into MM-dd-yyyy 
   */ 
   
  function convert_date ($date, $type='short') { 
    $month_list['short'] = array ('', 'Jan.', 'Feb.', 'Mar.', 'Apr.', 
      'May', 'June', 'July', 'Aug.',' Sept.', 'Oct.', 'Nov.', 'Dec.'); 
    $month_list['long'] = array ('', 'January', 'February', 'March', 
      'April', 'May', 'June', 'July', 'August', 'September', 'October', 
      'November', 'December'); 
    list($year, $m, $day) = split("-", $date);     
    $date = $month_list[$type][intval($m)] . " " . $day . " " . $year; 
    return $date; 
  } 
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PHP

Post navigation

Previous post
Next post

Related Posts

MSSQL – Data Transfer

Posted on March 10, 2014October 26, 2015

Recently I had to transfer ICD9CM codes from one database to another with limited database permissions, I decided to let the database work for me to perform the task. Ideally you’d have Visual Studio SSIS or some other mass data transfer option but this query will help you to get…

Read More

Swift – iOS – GPS – Coordinates – Lat/Long to DMS

Posted on June 8, 2018

If you have a need for displaying the GPS location information in Degrees, minutes, and seconds (DMS) format these functions will help you out. func latlon2DMS(latitude: Double) -> String { var latitudeSeconds = latitude * 3600 let latitudeDegrees = latitudeSeconds / 3600 latitudeSeconds = latitudeSeconds.truncatingRemainder(dividingBy: 3600) let latitudeMinutes = latitudeSeconds…

Read More

Bash – Suction (Move files from subfolders into parent)

Posted on April 9, 2018December 13, 2022

find . -mindepth 2 -type f -print -exec mv {} . \; # Delete empty directories find . -depth -empty -type d -exec rm -rfv {} \; Originally Posted on April 9, 2018Last Updated on December 13, 2022 All information on this site is shared with the intention to help….

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes