473,769 Members | 4,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change date format using XSLT

3 New Member
Hi,
I have a problem in transforming date format.
Originally I transform an access database data into XML then transform the XML doc into another XML with different strucutre.
The original date./time formating is : e.g. 2007-10-25 12:45:00
and I would like to transform in using xslt to format : 25-10-2007 12:45:00

does anyone know how to do this ???
thx
Jul 16 '07 #1
6 9858
jkmyoung
2,057 Recognized Expert Top Contributor
It's not pretty. In verbose form, for better understanding:
<xsl:variable name="year" value="substrin g(.,1,4)"/>
<xsl:variable name="month" value="substrin g(.,6,2)"/>
<xsl:variable name="day" value="substrin g(.,9,2)"/>
<xsl:variable name="time" value="substrin g(., 11, 9)"/><!-- includes leading space -->
<xsl:value-of select="concat( $day, '-', $month, '-', $year, $time)"/>
Jul 16 '07 #2
nataria
3 New Member
what does it mean ,, the number in the parameter concate ?? I tried similar method ..but it doesnt want to catch it .
I will post the code the i made soon /..
thx
Jul 18 '07 #3
jkmyoung
2,057 Recognized Expert Top Contributor
http://www.w3schools.com/xpath/xpath...ons.asp#string

This defines both the concat (concatenate, join strings) and the substring function.
Jul 18 '07 #4
nataria
3 New Member
it worked..
:D :D
thxxx
Jul 18 '07 #5
nagashesh
1 New Member
HI.

im Nag. i am facing similar issue in changing the date format. could you please help me on this string functions with some example

Thanks
Nov 5 '07 #6
jkmyoung
2,057 Recognized Expert Top Contributor
I'm not sure how much clearer to be. If you want to specifically change one date format to another, post both formats here. In the meantime, look at the link provided in the post above.
Nov 5 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4845
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime before Windows 2000 Service Pack 4 and has remained through to Windows XP. I am looking for a solution that doesn't involve rewriting our application (much) and that allows all our users to keep using Hebrew Regional Settings. To summarize our...
3
1591
by: Wayne Wengert | last post by:
I want to create a HTML page from an XML document using XSLT. The date values in the XML document are in the ISO format. I want to have the web page display something like "7/15/2004" for the date and in another case I want "HH:MM" for time of day. Can anyone point me to some resources explaining how to accomplish this? Thanks Wayne
2
6853
by: Rick | last post by:
I have an XML document that is generated from Infopath, I need to change the value of a namespace that is defined in a node in the form: <xsf:xDocumentClass "xmlns:my=valuehere">. when i navigate to the namespace value it is read only and cannot be changed. Can anyone tell me how to change this value? My Code: Dim sSingleNode As XmlNode = objDoc.SelectSingleNode("//xsf:Node", NamespaceManager)
3
5998
by: RJA | last post by:
Hiyas, Using VS .net 2003. Setting up a Webservice that accepts 3rd party vendor designed XML requests and returns a filled XMLDocument with response data. Vendor XSDs were serialize into class objects to be used in the program. EX: Used xsd.exe to turn VendorA_Request.XSD into VendorA_Request.cs EX: Used xsd.exe to turn VendorA_Response.XSD into VendorA_Response.cs
2
6578
by: martin.roclawski | last post by:
xsl newbie question: I don't seem to be able to find a simple function to convert a date in DD/MM/YY format to an integer since Epoch. I have the DD/MM/YY value in one mySQL database and trying to dump the data into another database - the app that's using the second database requires the date to be an integer. Surely this is a fairly common requirement to transform dates to and from the integer value?
2
2425
by: vaibhav | last post by:
Hi I am writing a wrapper over the XALAN XSLT engine, for transforming XML documents. My problem is that I need to pass date as a parameter ( with format mm/dd/yyyy hh.mm.ss) to the XSLT engine at run time (using the api setStylesheetParam(char* key, char* expression)). The first argument to setStylesheetParam is the key value and the second argument is the date expression ( eg it may be like , char* exp = "12/12/2006 12.12.00 "). But...
1
1716
by: ipramod | last post by:
Hi, I have an predefined XML format, lets say: <employee id="1111"> <name></name> <addr></addr> <salary></salary> </employee>
1
4555
by: Sandeep Singh | last post by:
Hi, How to convert date format from MM/dd/yyyy to yyyyMMdd in the XSLT. Is there any method to convert. I am getting date in the XML as string. Plx response on the same group. Thanks in advance
2
1322
by: Peter Laman | last post by:
My XML data contains elements with a date attribute. I need to write an XSLT transformation that only selects the elements for the current month. Is that possible with XSLT only, or should I preselect the data a different way? Thanks
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.