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 October 11th, 2004, 05:31 AM
Registered User
 
Join Date: Oct 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default converting Datestring to milliseconds

Hi,
i searched a long time in the internet and could'nt find a solution that worked.
I want to convert a date-string like '31.12.2004 23:00' to milliseconds.

Last thing i tried was this:

<xsl:variable name="format" select="'EEEE'"/>
<xsl:variable name="formatter" select="java:java.text.SimpleDateFormat.new($forma t)"/>

<xsl:variable name="date" select="java:IntDate.getDate('12.10.2004 23:00')"/>

    <p>Date: <xsl:value-of select="java:format($formatter, $date)"/></p>

but this gave me no output at all.
I need this because i want to make two buttons at the end of a list of Products per hour. The first button shows products one hour in the past an the other one shows products one hour in the future. This already works, because i made it with string operations (10 to 11 to 12...). But when i come to the next day there is no chance to make it with string operations becaus i have to change the Date and not only the hours. So i wanted to calculate the date via those millisecs, but found nothing to convert that string.

Any ideas?







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Milliseconds from DateDiff ? ashu_from_india Pro VB 6 2 July 5th, 2007 03:27 AM
Milliseconds MathLearner Beginning VB 6 0 May 15th, 2007 07:44 AM
Converting datetime to milliseconds since.. ravishakya SQL Server 2000 1 September 11th, 2006 07:47 AM
DateTime control which takes upto milliseconds lmadhavi Visual C++ 1 September 17th, 2004 07:57 PM
Generate Time in Milliseconds with asp niravp Classic ASP Databases 1 May 5th, 2004 03:32 PM





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