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 23rd, 2006, 03:10 AM
Registered User
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Conversion of Timestamp into Millis

Hi,

  could any provide me with the XSLT 2.0 code which converts the system TIMESTAMP into Milliseconds
thanks in advance

regards,
ramesh

 
Old November 23rd, 2006, 04:49 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Not sure what you mean but I would think that you'd use substring, substring-before etc. If that's not enough show how a TIMESTAMP is represented and which part is the milliseconds.

--

Joe (Microsoft MVP - XML)
 
Old November 23rd, 2006, 05:30 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

(current-dateTime() - dateTime('1900-01-01T00:00:00') (:or whatever baseline you want to use :) ) div xs:dayTimeDuration('PT0.001S')

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 23rd, 2006, 05:44 AM
Authorized User
 
Join Date: Dec 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ramesh.kumarm
Default

A Timestamp would rather be something like what Michael has shown
'1900-01-01T00:00:00' - Still it can contain Milliseconds at the end too.

So just strip off the string-after T and have a logic to show/calculate the hh:mm:ss:SS to SS [where SS is the denotion for Milliseconds]






Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeStamp nay_ctg BOOK: Beginning Cryptography with Java 1 August 7th, 2008 07:37 PM
Timestamp Problem hernann Java Databases 5 September 26th, 2007 07:51 AM
XSLT unix timestamp conversion Weezel XSLT 2 January 28th, 2005 02:12 PM
timestamp isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 November 18th, 2004 06:23 PM
Timestamp and sql nevada city J2EE 3 June 24th, 2003 11:20 PM





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