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

FormatDate Function

Posted on June 10, 2014October 26, 2015 By David Kittell
public string FormatDate(string sDate)
	{
		string formatteddate = "";
		try
		{
			//DateTime d = Convert.ToDateTime(Date);
			DateTime d = DateTime.Parse(sDate);
			string format = "MM/dd/yyyy";
			formatteddate = d.ToString(format);
			return formatteddate;
		}
		catch
		{
			return formatteddate;
		}
	}
Originally Posted on June 10, 2014
Last Updated on October 26, 2015
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

PowerShell – IPv4 Range

Posted on March 10, 2016March 10, 2016

This first function is helpful to provide a range of IPv4 addresses within a set range function New-IPRange ($start, $end) { # created by Dr. Tobias Weltner, MVP PowerShell $ip1 = ([System.Net.IPAddress]$start).GetAddressBytes() [Array]::Reverse($ip1) $ip1 = ([System.Net.IPAddress]($ip1 -join ‘.’)).Address $ip2 = ([System.Net.IPAddress]$end).GetAddressBytes() [Array]::Reverse($ip2) $ip2 = ([System.Net.IPAddress]($ip2 -join ‘.’)).Address for ($x=$ip1; $x…

Read More

Android Contacts – Working With Duplicates

Posted on March 26, 2014October 26, 2015

While this line is not necessary it’s a good idea to limit to this initially until you are ready to run on a larger scale. AND data1 LIKE "%<Organization Name>%" SELECT _id ,raw_contact_id ,data1 ,data4 ,data5 FROM data WHERE mimetype_id IN ( SELECT _id FROM mimetypes WHERE mimetype LIKE "%organization%"…

Read More

Distinct Query On One Column

Posted on May 20, 2014October 26, 2015

While this query has more than what may be needed this will help you to get data based on one unique column. SELECT [File Name] ,[Division] ,[Version] FROM ( SELECT [File Name] ,[Division] ,[Version] ,row_number() OVER ( PARTITION BY [Division] ORDER BY [Version] DESC ) AS RowNumber FROM <DatabaseTableName> )…

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