Solved

Formatting dates in XSL

Posted on 2012-04-11
2
289 Views
Last Modified: 2012-06-27
I am currently transforming XML into an HTML table using XSL.

The XML file is a collection of 'Roads' - which I am rendering out to a table.

XML: http://sandbox5.project4.net/date/roads_locs.xml
XSL: http://sandbox5.project4.net/date/roads.xsl
HTML Output: http://sandbox5.project4.net/date/default.asp

You may note in the XSL that I have a couple of date properties for each <road> element, these are <observed> and <updated>

The format for these dates is <observed>mm/dd/yyyy h:m:s PM or PM</observed>

Question: What options are available using XSL to format these dates differently?
0
Comment
Question by:sonic1234
2 Comments
 
LVL 6

Accepted Solution

by:
yawkey13 earned 500 total points
ID: 37835855
Here is a good date format function.  It's a few years old, but works.  

http://geekswithblogs.net/workdog/archive/2007/02/08/105858.aspx

There might be newer built in methods, but I haven't used XSL in a while.
0
 

Author Comment

by:sonic1234
ID: 37835867
Thanks, looks like the smartest method might be to simply create a number of different formatted date items in the XML rather than trying to format it using XSL
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now