Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2007, 05:22 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default converting dates: day of week

Is there an easy way using XSLT 2.0 to find out the day of the week (Monday, Tuesday, etc) from the date format 2008-01-01T00:00:00-06:00?

I know about using exslt extensions, but need a solution that would be supported by Saxon.
 
Old November 27th, 2007, 05:52 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use format-date() and one of the options is to get the day of the week, which will be in a standard representation if you use the ISO calendar.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 28th, 2007, 11:24 AM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If I want to convert 2008-11-28T00:00:00-06:00 to Wednesday 11/28 am I correct to assume the following function is correct:

assuming $d is 2008-11-28T00:00:00-06:00

format-date($d, "[FNn] [M01]/[D01]")





Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the same day of the week. crabjoe Classic ASP Basics 3 February 27th, 2008 12:45 PM
DAY of the week wdepreter Excel VBA 3 February 7th, 2007 06:44 AM
Day of week finder mrjaygreene Classic ASP Basics 6 May 13th, 2006 04:43 PM
Conversion to 7 day week. kinouye BOOK: Beginning VB.NET Databases 0 December 3rd, 2005 03:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.