DateTime format to ISO 8601 -- won't change???

  • Thread starter Thread starter Kathy Burke
  • Start date Start date
K

Kathy Burke

Hi, I've read every post I could find but still no luck on why this
won't work for me. I have an aspx page (U.S. default, VB, .Net 1.1),
where I use the following two variables:

Dim varStartTime As DateTime = DateTime.Now.ToString("t")
Dim varStartDOM As DateTime = DateTime.Now.ToString("s")

The first gives me the time portion of date/time as expected. The second
just gives me date/time in U.S. format and what I need is the ISO 8601
format. I just need it for a variable (varStartDOM) added to an xml
string, not for all datetimes in the app to be in the ISO 8601 format
(not by my choice, of course).

Any help appreciated!!!

Thanks,

Kathy
 
Having not used this before, I finally realized I needed an Import
System.DateTime in my aspx.

Now, DateTime.Now.ToString("s") translates correctly into sortable ISO
format 'yyyy-MM-ddTHH:mm:ss'.

Hope this helps someone else some day!

Thanks,

Kathy
 
Back
Top