To File Date - CSharp System

CSharp examples for System:DateTime Format

Description

To File Date

Demo Code

// Copyright (c)2008-2011 Mark II Software, LLC.  All Rights Reserved.
using System.Text;
using System.Collections.Generic;
using System;/*from  w w w .  j  a  va2  s. com*/

public class Main{
        // Format as YYYYMMDD
        public static string ToFileDate(this DateTime dt)
        {
            return dt.ToString("yyyyMMdd");
        }
}

Related Tutorials