Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

client side code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Claudia Fong - 12 Dec 2007 07:17 GMT
I got this code in my client side but I'm not sure what this supposed to
do.. can someone tell me?

function FormatXMLTime(aTime)
    {
       // Extract the date
       //
       var date = aTime.substring(0, aTime.indexOf("T", 0));
       
       // Remove the date.
       //
       var temp = aTime.replace(date, "");
       var temptime = temp.replace("T", "");
       
       // Extract the time.
       //
       var time = temptime.substring(0, temptime.indexOf("-", 0));
       
       return time;
}

return time won't return anything.. if I put this code
return date + " " + time; then it will return only the  date
But I check the format of the date/time in the xml file and it's like
this:

2007-12-04T09:26:59.953+00:00

So does that means this function won't return the time or the function
is not getting the substring of the time?

Cheers!

   Claudi
Hans Kesting - 12 Dec 2007 08:45 GMT
Claudia Fong explained on 12-12-2007 :
> I got this code in my client side but I'm not sure what this supposed to
> do.. can someone tell me?
[quoted text clipped - 26 lines]
> So does that means this function won't return the time or the function
> is not getting the substring of the time?

"temp" should contain "T09:26:59.953+00:00"
"temptime" should contain "09:26:59.953+00:00"
(although you could have gotten here with a substring *from* the "T")

but then you search for a "-", did you mean a "+"?

And a different way could be:
var date = aTime.substring(0, 10);
var time = aTime.substring(11, 8);
as the lengths are fixed.

Hans Kesting

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.