Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using javascript date functions



I'm trying to create some countdown timer animations. There is no tool to convert from a
real date back to QC seconds since 2001 so I'm trying to use the built in javascript functions.


I've tried the following javascript:
var date = new Date("2006,01,01,00,00,00");
var now = new Date();
var diff = date.getTime() - now.getTime();
outputs[0]=diff;
outputs[1]=date.getMilliseconds;
outputs[2]=now.getMilliseconds;

but outputs 1 and 2 return QCStructures with zero elements? Date is part of core javascript
so this should work as far as I can tell?

I think you're returning a function instead of a value and should be doing this:


outputs[1]=date.getMilliseconds();
outputs[2]=now.getMilliseconds();



________________________________________________________
Pierre-Olivier Latour                            email@hidden
Quartz Composer Architect                Graphics & Imaging Team

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >using javascript date functions (From: "Roger Bolton" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.