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

C# Date/Time String Conversion

Posted on December 13, 2013December 26, 2018 By David Kittell
public string GetLongDate(string Date)
{
DateTime d = Convert.ToDateTime(Date);
string format = "dddd,MMMM dd,yyyy";
string formatteddate = d.ToString(format);
return formatteddate;
}
public string GetDOBDate(string Date)
{
DateTime d = Convert.ToDateTime(Date);
string format = "MM/dd/yyyy";
string formatteddate = d.ToString(format);
return formatteddate;
}
Originally Posted on December 13, 2013
Last Updated on December 26, 2018
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 CSharp

Post navigation

Previous post
Next post

Related Posts

Oracle Clean Date Format

Posted on September 18, 2013October 26, 2015

Sometimes you have to pull a date from Oracle in a cleaner format, this is one way to achieve the format you want. // Convert the Oracle date 19000101 to 01-01-1900 public string OracleCleanDate(string strDate) { if (strDate.Length == 8) { string strYear, strMonth, strDay; strYear = strDate.Substring(0, 4); strMonth…

Read More

Update IP Location Column

Posted on October 10, 2013October 26, 2015

UPDATE pageview SET pageview.IPLocation = ( SELECT TOP 1 (city + ‘, ‘ + region + ‘ ‘ + postalCode) FROM GeoCityLocation glcl INNER JOIN [GeoCityBlocks] glcb ON glcl.locId = glcb.locId WHERE ( pageview.[ipint] BETWEEN startIpNum AND endIpNum ) AND region = ‘MI’ ) WHERE url LIKE ‘%<URL>%’ AND IPLocation…

Read More

Mac OS X – Remove Users In Terminal/SSH

Posted on February 19, 2016March 30, 2016

Recently I had to remove users from a Mac that was on a network only with SSH available. In this document I use the user name “administrator” as the account that I do the work in and would like to keep, your user name may be different. First we need…

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
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes