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

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
 
K

Kathy Burke

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
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top