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 January 27th, 2005, 07:19 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT unix timestamp conversion

Hello,
I have dates/times in xml in the following format:
01/27/05 21:30
and i need to convert that into a unix timestamp using xslt

how do i do that?...expecially since the xslt native library cant do it...i've googled around quite a bit looking for something, but i cant find anything...

i'm pretty new w/ xslt...any ideas?
 
Old January 28th, 2005, 01:16 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

What format is Unix timestamp?

--

Joe (Microsoft MVP - XML)
 
Old January 28th, 2005, 02:12 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Unix time number is zero at the Unix epoch, and increases by exactly 86400 per day since the epoch. Thus 2004-09-16T00:00:00Z, 12677 days after the epoch, is represented by the Unix time number 12677 * 86400 = 1095292800. This can be extended backwards from the epoch too, using negative numbers; thus 1957-10-04T00:00:00Z, 4472 days before the epoch, is represented by the Unix time number -4472 * 86400 = -386380800.

http://en.wikipedia.org/wiki/Unix_timestamp

i really dont wanna write code that figures out how many days since the unix epoch (Jan 1st, 1970)

so i guess to answer your question...its a big integer





Similar Threads
Thread Thread Starter Forum Replies Last Post
UNIX Date Conversion darrenb Access 4 March 11th, 2008 06:27 AM
XSLT Windows v's Unix issue fbrody XSLT 1 December 15th, 2006 06:25 AM
XML to XSLT conversion?? Hannibal XSLT 16 November 24th, 2006 06:52 AM
Conversion of Timestamp into Millis rameshnishi XSLT 3 November 23rd, 2006 05:44 AM
UNIX Timestamp apek PHP How-To 4 January 20th, 2004 02:05 PM





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