Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XSL - Date/Time string requires formatting based on value in another element >Thread Next - Re: XSL - Date/Time string requires formatting based on value in another element Re: XSL - Date/Time string requires formatting based on value in another elementTo: NULL Date: 11/9/2007 2:48:00 PM Im using XMLSpy 2007, its part of a university assignment and I must only use XSL/XST on a windows platform to implement the solution and for the output to be HTML. I was thinking but dont have the technical knowledge to appy it :- datetime = 12/01/07 14:05 $Hour =substring(my:PODBatch/my:POD/my:DeliveryInfo/my:DeliveryDateTime,10,2) = 14 TimeZone = GMT+2 $Timezonedifference = substring(my:PODBatch/my:POD/my:Customer/myTimeZone,4,1) = 2 Then would have to peform a calculation to ensure the hour is added on correctly using 24 hour clock i.e. 23:05 00:05 Then replace the new value back into the datetime element. Hope this makes sense and thanks for your help. Cheers Rob "Anthony Jones" <Ant@y...> wrote in message news:%23wc7FvtIIHA.1184@T...... > "Rob W" <Whllrob@a...> wrote in message > news:OywtlStIIHA.4228@T...... >> I've set up the date & time (dd/mm/yy hh:mm) in my XML schema as a string >> and within my XSL stylesheet I would like to use substring to grab >> the hh element, store it as a integer variable. >> >> The take the last character from time zone element i.e GMT+1, GMT+2 =1,2 > to >> grab the number store this as an integer value. >> >> Peform calculation and then replace the hh element within the date & time >> element with the newly calcualte one. >> > > > There is more to it than that what if you need to add 3 hours to 22:00? > Won't you need to upgrade the date? What if the date is 31/12/07? > > What flavour of XSL are you using? Does the solution need to stick > strictly > to what XSL provides or are you happy to use a platform specific > extension? > What is your platform? > > > -- > Anthony Jones - MVP ASP/ASP.NET > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
