Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2007, 01:48 AM
Authorized User
 
Join Date: Oct 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display date as mm-dd-yy (without century)

Hi,

Is there a way to customize format of shortdate in asp.net? I would like to display the date as mm-dd-yy, the year without the century.
I have tried

String.Format("{0:mm/dd/yy}", myDateVar)

but still, it displays year in four digits as yyyy.

Thanks in advance.

 
Old May 9th, 2007, 03:21 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

How about taking idea from the below:

Response.Write(DateTime.Now.ToString("MM-dd-yy"));

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing date in dd/mm/yyy format mike_remember ASP.NET 2.0 Professional 1 May 13th, 2008 04:23 AM
Date dd-mm-yyyy John2112 SQL Server 2000 2 March 16th, 2007 05:15 AM
Convert date String (dd/mm/yy) to dd- Month- yy minhpx J2EE 2 March 6th, 2007 08:29 AM
Converting date to yy.mm.dd format using CONVERT Jinn SQL Server 2000 6 October 14th, 2006 06:44 PM
Date formats... dd/mm/yyyy SeanW Classic ASP Databases 3 June 14th, 2004 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.