How to get the dateformat (yyyymmdd)

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

e.g my date is 02-02-2005
now, How can I get the format into 20050202 ??
thanks a lot
Btw, As i remember, there is a web site which let us to search the old post
? (I resinstall my PC, so all the bookmark disappear)
Does anyone know ?
 
Agnes,
I normally use DateTime with a custom date format, something like:

Dim theDate as DateTime = #02/02/2005#

Dim ymd As String = theDate.ToString("yyyyMMdd")

Note MM is month in the custom format, while mm is minutes.

For details on custom datetime formats see:

http://msdn.microsoft.com/library/d...s/cpguide/html/cpcondatetimeformatstrings.asp

For information on formatting in .NET in general see:
http://msdn.microsoft.com/library/d...y/en-us/cpguide/html/cpconformattingtypes.asp

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top