• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Conversion of Current Time In Milliseconds using XSLT

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to covert current date time into milliseconds using XSLT.
I am using follwoing code to get current time.



With this code I am getting following response



How can I convert this value(2011-04-15T04:38:50-04:00) of current time in milliseconds using XSLT?
 
Ranch Hand
Posts: 729
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say in milliseconds, I guess you have some reference date in the past in mind (if not 0000-01-01)? and that effectively makes it some kind of dataTimeDuration. Then you can use days/hours/minutes/seconds-from-duration() to get those components. Some nominal arithmetic on them would give you the milliseconds.

Also with version 2.0, you can take profit of the built-in current-dateTime() rather than using exslt function library.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!