So I've managed to figure this out, but I had to use straight JavaScript 
and ignore Python's timedelta objects completely.

JS("""
            var defaultStart = new Date()
            var defaultEnd = new Date(defaultStart.getTime() + (60*60*1000))
""")

On Tuesday, October 23, 2012 5:37:03 PM UTC-5, Matt wrote:
>
> I'm running into some strange behavior when using timedelta objects.
>
> *Code:*
> startTime = datetime.now()
> endTime = startTime + timedelta(hours=1)
> print startTime
> print endTime
>
> *Results (in JavaScript console):*
> 2012-10-23 17:19:39.241000
> 2012-11-23 18:23:40
>
> So instead of adding one hour to startTime, it added 1 month, 1 hour and 4 
> minutes. Any ideas? If there's a different/better way to do this, please 
> let me know!
>
> Thanks in advance!
>

-- 



Reply via email to