ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

GetDate

Return the current date and time

Source

public static class ExtensionMethod
{
public static DateTime GetCurrentDate(this object source)
{
return DateTime.Now;
}
}

Example

object anything = new object();
DateTime date = anything.GetCurrentDate();

Author: Thor Jack

Submitted on: 25 mrt. 2015

Language: C#

Type: System.DateTime

Views: 5132