Novell Home

Converting "Miliseconds Since 1970" to Readable Date Format

Novell Cool Solutions: Tip
By Veli-Matti Luotonen

Digg This - Slashdot This

Posted: 27 Jun 2007
 

Problem

In IDM UserApp, I need to convert an attribute value saved in eDirectory as "milliseconds from 1970" to a readable date format.

Solution

Add the following code for reading the attribute into the form:

d=new Date();
d.setTime(IDVault.get(recipient,'user','endDate') *1000);
p=d.getDate()+"."+d.getMonth()+"."+d.getFullYear();

Note that the Attribute end date must be added to the Directory Abstraction Layer.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell