asp.net consultancy chorley ASP.NET Server Side Scripting Wigan
Website Development Radcliffe

IT Services And Support

Email : ren@techsolus.co.uk
Mobile Phone : 0788 68 41 411
Answerphone : 01204 469683
bespoke invoice systems Standish Information Technology Advice Worsley
    development systems Ramsbottom
data manipulation Farnworth access databases Whitefield SQL connections Atherton
online accessible software Leyland software compatible Coppull


Get connected and Online Tottington
remote management Makerfield code and design Aspull

ASP.NET System.DateTime.Now.Tostring Simple Examples - 13/01/2011

System.Datetime.Now - great innit! This will simply pull up the present date and time details - as they are on the server at least.
but it's good to be able to format this in the way you want - so here are some examples.

system.datetime.now.tostring("yyyyMMdd-HHmmss")

Will Give 20110113-143245

system.datetime.now.tostring("yyyyMMdd HH:mm:ss")

Will Give 20110113 21:55:34

system.datetime.now.tostring("ddMMyyyy HH-mm-ss")

Will Give 13012011 13-54-32

And so on...

Post A Comment

Name Comment
programming services asp.net specialist
Valid XHTML 1.0 Transitional
Admin
GD