Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
squished18
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers
Accepted Solution

Date.valueOf() not working as expected

[ Edited ]

Hello,

 

According to http://www.w3schools.com/jsref/jsref_valueof_date.asp, the method .valueOf() should return an integer number of milliseconds for the given date. However, when running my app I am getting a UTC string (e.g. "Thu Jan 19 2012 21:50:23 GMT+0000 (Eastern Standard Time)") when I use this method.

 

Would anyone know how do I get the equivalent milliseconds conversion for a given date?

 

I am currently using OS 7.0 on a 9810.

 

Thanks,

 

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Please use plain text.
Developer
squished18
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers

Re: Date.valueOf() not working as expected

bump

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Please use plain text.
Developer
Simpler
Posts: 49
Registered: ‎01-17-2010
My Device: Curve 9300

Re: Date.valueOf() not working as expected

Have you tried:

 

var d=new Date();
document.write(d.getTime());

 

I haven't tried this myself, but it should work.

- Simulator 6.0.0.668 (9300)
- Windows 7 64bit
- Curve 9300 with App Version: 6.0.0.668 (2949)
Please use plain text.
Developer
squished18
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers

Re: Date.valueOf() not working as expected

That worked. Thanks!

feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Please use plain text.